feat(gateway): improved error handling, support for 502 and 504#182
Merged
feat(gateway): improved error handling, support for 502 and 504#182
Conversation
Codecov Report
@@ Coverage Diff @@
## main #182 +/- ##
==========================================
+ Coverage 29.57% 30.32% +0.75%
==========================================
Files 100 100
Lines 11241 11359 +118
==========================================
+ Hits 3324 3445 +121
+ Misses 7547 7540 -7
- Partials 370 374 +4
|
65acc04 to
30f26b3
Compare
1 task
lidel
requested changes
Feb 23, 2023
Member
There was a problem hiding this comment.
Thank you, finally human-readable errors! 🙃
I had no time to take it for a spin, but dropped some small asks below and for:
! returns 500 by default when name resolution errors instead of 400 (breaking).
See my question in ipfs/kubo#9660 (comment)
0f13d3c to
be6e09c
Compare
404f74a to
3a96006
Compare
c4c5b37 to
88f007f
Compare
lidel
reviewed
Feb 24, 2023
I believe the context timeouts gateway code will hit are not related to client not sending data, so 408 was invalid here.
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.
Improves the error handling for the gateway.
Ensures that theinternalWebErrorgoes throughwebError, which deferences into the correct error.internalWebErrorand just usewebErrorinstead.webError(w, message, error, code)towebError(w, err, code). The error should contain all the required information. In many places we were just duplicating the error information for no reason.errors.Isfor all the remaining errors to ensure we catch them all.isErrNoLink. The reason why is explained in the comment.