Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve error handling and logging in get_param_limits method #118

Merged

Conversation

jontofront
Copy link
Owner

This pull request includes several important changes to the custom_components/econet300/api.py file, focusing on improving error handling and logging for API parameter limits fetching. The most important changes are:

Error Handling Improvements:

  • Added multiple exception handlers (KeyError, ValueError, TypeError, RuntimeError) to the get_param_limits method to catch and log specific errors that may occur during the fetching of parameter limits.

Logging Enhancements:

  • Improved logging in the get_param_limits method to provide more detailed error messages, including the specific parameter name and the URI when limits data fetching fails.

Code Structure:

  • Added a try block to the get_param_limits method to ensure that errors are caught and handled appropriately, preventing the method from failing silently.

These changes enhance the robustness and maintainability of the code by providing clearer error messages and handling potential exceptions more gracefully.

@jontofront jontofront merged commit f2753bc into 80-bug-data-for-key-data-does-not-exist Dec 12, 2024
4 checks passed
@jontofront
Copy link
Owner Author

#80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants