Skip to content

Move Error Handling to the econnect-python Client #151

@palazzem

Description

@palazzem

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

  • Leaving error handling to the client applications, which results in duplicated code and inconsistent handling strategies.
  • Using multiple custom exceptions for different error types, which could still lead to complex handling in client applications.

Additional context
n/a

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions