(self)
| 48 | |
| 49 | impl 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 | } |
no test coverage detected