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

@ -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
// TODO: DO NOT UNWRAP HERE! ANY FAILING MESSAGES SHOULD KEEP THE CONNECTION!
.map_or_else( .map_or_else(
|err| { |err| match err {
// need to think about this FrontendErrorResponse::Anyhow(err) => Err(err),
todo!("do something to convert FrontendErrorResponse into a JsonRpcForwardedResponseEnum"); _ => {
}, error!("handle this better! {:?}", err);
|(response, _)| response Err(anyhow::anyhow!(format!("unexpected error! {:?}", err)))
);
Ok(x)
} }
},
|(response, _)| Ok(response),
),
}; };
(id, response) (id, response)