-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Improve async generic camera's error handling #4316
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use aiohttp.errors.ClientError
to handle more exception.
I think it is related, but in my case since |
Let me add |
Testing this change out now. I don't see any reason why it wouldn't fix the issue though since |
|
@pvizeli is right DisconnectedError is the base exception for both server and client. Use |
why not in this way: #4325 |
@pvizeli I prefer to show the reason why it failed and not hiding too much by only saying "error on URL x" Also changed the yr.no handling to be similar (the current implementation is most likely not working) |
In my testing with the latest changes I still see the errors described in #4294. If this isn't the appropriate place to catch the |
You are sure, that you test with this branch? |
Yes. I double checked and have the altered lines in my generic camera file. The thing is I'm having trouble recreating the exact error I get with when using the wunderground url listed in my issue. I had originally thought it was a result of the url not being available, but that doesn't reflect in my tests. It seems the wunderground server is returning a different error in the cases when the exception pops up and I haven't been able to catch it yet. In any case, the changes proposed are a step forward and successfully catch other connection issues. It may be best to merge this in and keep issue #4294 open until I'm able to get a better handle on what wunderground is actually doing when the errors get logged. |
* Handle errors * Feedback * DisconnectedError
Description:
Handle connection errors for generic camera in the async version similar to the non-async version (see line 103)
Logs currently fills with the following error:
Related issue (if applicable): fixes #
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>
Example entry for
configuration.yaml
(if applicable):Checklist:
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests pass