-
Notifications
You must be signed in to change notification settings - Fork 9
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
Return meaningful errors #133
Comments
IIRC, the body is checked in gateway conformance tests for some failure cases, i.e. https://github.com/ipfs/gateway-conformance/blob/9beb71f432a1e83f2dbc10031612991570ef5397/tests/path_gateway_dag_test.go#L371 We will need some sophisticated handling in verified-fetch to determine whether to surface compliance required error messaging vs error stack traces and whatnot in order to render a useful page here. Do we want to return this error page HTML from |
Good catch, the conformance test you linked is too specific, This allows us to separate concerns, and have branded HTML in service worker:
|
I think verified-fetch will need to return application/json errors in Responses (not text/plain) for us to get a useful stacktrace here. |
|
iiuc, right now, we seem to return error that produces default error from browser engine:
https://github.com/ipfs-shipyard/helia-service-worker-gateway/blob/41d2cffcff5bc3061212fe13aadb5df9c1a3f64c/src/sw.ts#L389
https://github.com/ipfs-shipyard/helia-service-worker-gateway/blob/41d2cffcff5bc3061212fe13aadb5df9c1a3f64c/src/sw.ts#L387
This makes it hard for user to reason what went wrong, and near to impossible to fill a meaningful error report.
Example: failure to fetch block during path walk
If you walk https://inbrowser.dev/ipns/en.wikipedia-on-ipfs.org long enough, you may hit a hiccup:
Proposed improvement
If we encounter an error while generating a Response within a service worker, we should always catch the error and respond with a meaningful HTML error page.
text/html
Pseudocode
The text was updated successfully, but these errors were encountered: