don't unwrap. still might be more errors to handle though

This commit is contained in:
Bryan Stitt 2022-12-23 12:12:17 -08:00
parent 1fecfd8821
commit 11a7aff8e0

View File

@ -245,21 +245,19 @@ async fn handle_socket_payload(
Ok(response.into()) Ok(response.into())
} }
_ => { _ => app
let x = app .proxy_web3_rpc(authorization.clone(), json_request.into())
.proxy_web3_rpc(authorization.clone(), json_request.into()) .await
.await .map_or_else(
// TODO: DO NOT UNWRAP HERE! ANY FAILING MESSAGES SHOULD KEEP THE CONNECTION! |err| match err {
.map_or_else( FrontendErrorResponse::Anyhow(err) => Err(err),
|err| { _ => {
// need to think about this error!("handle this better! {:?}", err);
todo!("do something to convert FrontendErrorResponse into a JsonRpcForwardedResponseEnum"); Err(anyhow::anyhow!(format!("unexpected error! {:?}", err)))
}, }
|(response, _)| response },
); |(response, _)| Ok(response),
),
Ok(x)
}
}; };
(id, response) (id, response)