(err: sea_orm::DbErr)
| 92 | impl IntoResponse for AppError { |
| 93 | fn into_response(self) -> Response { |
| 94 | let message = self.to_string(); |
| 95 | let (status, code, details) = match self { |
| 96 | AppError::BadRequest(_) => (StatusCode::BAD_REQUEST, "BAD_REQUEST".to_string(), None), |
| 97 | AppError::Unauthorized => (StatusCode::UNAUTHORIZED, "UNAUTHORIZED".to_string(), None), |
| 98 | AppError::Forbidden(_) => (StatusCode::FORBIDDEN, "FORBIDDEN".to_string(), None), |
| 99 | AppError::TooManyRequests(_) => (StatusCode::TOO_MANY_REQUESTS, "TOO_MANY_REQUESTS".to_string(), None), |
| 100 | AppError::NotFound(_) => (StatusCode::NOT_FOUND, "NOT_FOUND".to_string(), None), |
no outgoing calls