fix: SocketException+HttpException mapped correctly while running natively#4993
Merged
Conversation
gae_server and local_server now use a BaseClient that catches the exception and return the cocoon_service one.
Contributor
|
🤖 Hi @jtmcdole, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
Contributor
There was a problem hiding this comment.
This PR correctly implements MappingHttpClient to wrap http.Client requests and map dart:io SocketException and HttpException to their cocoon_service equivalents. This ensures backend operations remain platform-agnostic and robust.
🔍 General Feedback
- The refactoring nicely encapsulates the error mapping logic within a custom HTTP client and injects it effectively throughout
Configand the different backend entry points (gae_server,local_server). - The new unit tests cover the expected behavior well.
- A couple of minor adjustments regarding error context preservation and object caching are recommended to further improve debugging capabilities and prevent redundant instantiations.
ievdokdm
reviewed
Mar 20, 2026
ievdokdm
requested changes
Mar 21, 2026
Contributor
|
autosubmit label was removed for flutter/cocoon/4993, because This PR has not met approval requirements for merging. Changes were requested by {ievdokdm}, please make the needed changes and resubmit this PR.
|
this is the non-dart-io package
ievdokdm
approved these changes
Mar 23, 2026
ievdokdm
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gae_server and local_server now use a BaseClient that catches the exception and return the cocoon_service ones.