-
Notifications
You must be signed in to change notification settings - Fork 21
Show error messages when connections fail #790
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
adca18f to
c2d175e
Compare
|
I am not convinced we want to add a failmessage to the URL-accessing function, it somehow feels too limited or unneeded. So (without having looked at what would be needed to cover this, enlighten me ;-)). We probably can describe 2 kind of issues:
For the first set of issues, I think we can get away with generic error handling and messages. The cause/resolution can also be generally be applied. This would either be caught using exception-handling, or testing HTTP error code within the calling function. For the second set of issues, usually HTTP errors, there may be different courses of action:
Could we instead raise HTTP errors as exceptions, and leave the handling/error message up to the exception-handling? This would allow both actions or escalation to the user. The interface could then simply consist of a list of HTTP errors that are caught in the calling code, and our URL-handling code would simply fall back to generic handling unless told otherwise. So instead of |
febe9f0 to
01000ae
Compare
|
I removed Currently the |
I wasn't sure if a custom exception would be easier to catch and select the exact error caught in a single catch-statement. So we could have a catch-statement per error-case. But that would require a custom exception per HTTP error I guess... |
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.
I like this implementation. The connection errors I would like to make more specific (we have quite a few specific ones listed in #385), which would mean the error messages could give more context. But merging this as a first version would be perfect.
Once we release this as part of v2.4.0 I think we need to ask our users to report any generic add-on errors (those that are not caught) or send us feedback on issues that do not match with the error statement so we can further refine error handling.
Another approach would be to handle any uncaught exception from the root and provide a generic error to report this error to us with full debug log. I am not sure if that is a good approach in general for the majority of our users. Some add-ons (e.g. Netflix) have this as an option.
|
Thinking about this further, having this part of a more common framework for all add-ons to reuse would be really useful too. |
b1d3e06 to
74cce34
Compare
Feel free to merge this. I tested this and it works fine. Kodi add-on errors shouldn't happen anymore. Refining the error messages is something we can do one by one as they happen. |
Trying to provide error messages in Kodi GUI for all network problems improving #385