palazzem / econnect-python

API adapter used to control programmatically an Elmo alarm system
BSD 3-Clause "New" or "Revised" License
8 stars 5 forks source link

Move Error Handling to the `econnect-python` Client #151

Open palazzem opened 1 month ago

palazzem commented 1 month ago

Is your feature request related to a problem? Please describe. Integrations using the econnect-python library, such as the Home Assistant integration (https://github.com/palazzem/ha-econnect-alarm), currently need to handle various exceptions raised by the library. This leads to duplicated code and inconsistent error handling across different integrations. It also increases the complexity of the client code that uses the library.

Describe the solution you'd like Implement centralized error handling within the econnect-python library itself. This involves defining a custom exception class (e.g., ElmoClientError) to encapsulate all specific error conditions. All exceptions raised by the library should be logged internally, and meaningful error messages should be provided to the client.

Describe alternatives you've considered

Additional context n/a