(self)
| 41 | |
| 42 | impl IntoResponse for AppError { |
| 43 | fn into_response(self) -> Response { |
| 44 | let status = match &self { |
| 45 | Self::BadRequest(_) => StatusCode::BAD_REQUEST, |
| 46 | Self::NotFound(_) => StatusCode::NOT_FOUND, |
| 47 | Self::Native(_) | Self::Internal(_) => StatusCode::INTERNAL_SERVER_ERROR, |
| 48 | }; |
| 49 | let message = self.to_string(); |
| 50 | (status, Json(ErrorBody { error: &message })).into_response() |
| 51 | } |
| 52 | } |
no outgoing calls
no test coverage detected