-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Developer should throw custom exception in interceptor #1950
Comments
This makes a lot of sense. I think we either should properly wrap the exception, or we shouldn't wrap it at all. |
I think we do. Just from looking at the screens, the reported exception probably originated at the |
These (#1949) are quite similar which requires a nicer first-look regarding the exception. |
Adding request information to the exception is one thing. Figuring out a sensible way to convert arbitrary exceptions/objects into strings is another. Any ideas for this? We call |
dio/dio/lib/src/dio_exception.dart Lines 176 to 178 in 4d7ea68
|
Based on the above comments, the root cause of the exception is the JSON fails to be decoded before it reaches your exception, so a Closing as it's working as intended. |
Not sure how we can achieve that other than the developer registering custom types somewhere. |
Has there been no progress on this issue? |
Request Statement
When i write a interceptor class extends Interceptor, in some case, i wish throw some exception to tell the developer some thing went wrong. so i throw a custom exception in override function 'onResponse', but this exception was catched by DioException, and this exception can not tell me more infomation about this error.
So, i wish this will be supported
Solution Brainstorm
No response
The text was updated successfully, but these errors were encountered: