-
Notifications
You must be signed in to change notification settings - Fork 187
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: html error handling #628
Conversation
.await | ||
.map_err(|e| GatewayError::new(StatusCode::INTERNAL_SERVER_ERROR, &e))?; | ||
// TODO: handle 404 or error | ||
let path_metadata = match state.client.retrieve_path_metadata(path.clone()).await { |
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.
@b5 this is the crucial bit - the earliest moment we ping store/p2p. I've updated error responses from fetch_gateway
and fetch_bitswap
so that it now catches them and returns a more sane response (failed to find {cid}
|| offline
).
We should do similar for fetch_store
to make it less jarring to the end users.
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.
tests :P ?
let path_metadata = match state.client.retrieve_path_metadata(path.clone()).await { | ||
Ok(metadata) => metadata, | ||
Err(e) => { | ||
if e == "offline" { |
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.
😭
closes n0-computer/beetle#253