mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-08-25 23:01:09 +00:00
fix: refactor of sequencer to return errors immediately
This commit is contained in:
@@ -43,8 +43,7 @@ impl JsonHandler {
|
||||
let message_inner = self
|
||||
.process_request_internal(request)
|
||||
.await
|
||||
.map_err(|e| e.0)
|
||||
.map_err(rpc_error_responce_inverter);
|
||||
.map_err(|e| e.0);
|
||||
Ok(Message::response(id, message_inner))
|
||||
} else {
|
||||
Ok(Message::error(RpcError::parse_error(
|
||||
|
||||
@@ -53,5 +53,9 @@ pub fn cast_seq_client_error_into_rpc_error(seq_cli_err: SequencerClientError) -
|
||||
match seq_cli_err {
|
||||
SequencerClientError::SerdeError(_) => RpcError::serialization_error(&error_string),
|
||||
SequencerClientError::HTTPError(_) => RpcError::new_internal_error(None, &error_string),
|
||||
SequencerClientError::InternalError(err) => RpcError::new_internal_error(
|
||||
err.error.data,
|
||||
&serde_json::to_string(&err.error.error_struct).unwrap_or(String::default()),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user