-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
[Dio] Replace failed http client adapter with interceptor #728
[Dio] Replace failed http client adapter with interceptor #728
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.
I agree with this decision.
That's fine, they are free to disable
How is
Only if they are using both features at the same time, and not configuring one or the other to avoid duplicate events. We're pretty much removing a feature that captures errors automatically based on the user's configuration, without any other alternative, unless I'm missing something here. |
That's what #718 fixes. |
Yep, got that, but event processors only run if there's a captured event, and with the removal of |
Wondering again if we should consider moving to an interceptor approach, which probably would solve most cases. |
Didn't thought that. Capturing crash manually would be bad. I like @kuhnroyal suggestion. Using interceptors we could capture the error but let the request continue its flow. |
…-request-adapter # Conflicts: # dio/lib/src/failed_request_client_adapter.dart
Codecov Report
@@ Coverage Diff @@
## main #728 +/- ##
==========================================
+ Coverage 90.56% 92.13% +1.56%
==========================================
Files 104 17 -87
Lines 3359 483 -2876
==========================================
- Hits 3042 445 -2597
+ Misses 317 38 -279
Continue to review full report at Codecov.
|
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.
LGTM
Co-authored-by: Manoel Aranda Neto <[email protected]>
Can this be merged, so I can integrate it to the other Dio PR? |
📜 Description
This PR removes the failed http client adapter from the Dio integrations.
There's no need for this functionality, as Dio can be configured to throw on certain status codes. The users are probably using Dios way, which would cause having to reports for a bad status code. For reference, see
ValidateStatus
here. So instead we're adding an interceptor which can listen for exceptions.We automatically listen for those exceptions and report them.
The reporting of DioErrors gets improved in #718
💡 Motivation and Context
This came out of the discussion over at #718 (comment)
💚 How did you test it?
New tests
📝 Checklist
🔮 Next steps