MCPcopy Create free account
hub / github.com/cowprotocol/services / into_response

Method into_response

crates/orderbook/src/api/debug_simulation.rs:50–73  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

48
49impl IntoResponse for OrderSimulationError {
50 fn into_response(self) -> Response {
51 match self {
52 OrderSimulationError::NotEnabled => (
53 StatusCode::METHOD_NOT_ALLOWED,
54 super::error(
55 "MethodNotAllowed",
56 "order simulation endpoint is not enabled",
57 ),
58 )
59 .into_response(),
60 OrderSimulationError::MalformedInput(err) => {
61 tracing::warn!(?err, "failed to parse order simulation input");
62 (
63 StatusCode::BAD_REQUEST,
64 super::error("BadRequest", format!("malformed input: {err}")),
65 )
66 .into_response()
67 }
68 OrderSimulationError::Other(err) => {
69 tracing::error!(?err, "failed to create simulation for order");
70 crate::api::internal_error_reply()
71 }
72 }
73 }
74}

Callers 2

debug_simulation_handlerFunction · 0.45

Calls 2

internal_error_replyFunction · 0.85
errorFunction · 0.50

Tested by

no test coverage detected