-
Notifications
You must be signed in to change notification settings - Fork 98
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
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
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.
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
I believe the context timeouts gateway code will hit are not related to client not sending data, so 408 was invalid here.
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.
Improves the error handling for the gateway.
Ensures that theinternalWebError
goes throughwebError
, which deferences into the correct error.internalWebError
and just usewebError
instead.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.Is
for all the remaining errors to ensure we catch them all.isErrNoLink
. The reason why is explained in the comment.