| 40 | .body(self.to_string()) |
| 41 | } |
| 42 | fn status_code(&self) -> StatusCode { |
| 43 | match self { |
| 44 | CollectionsError::NotFound => StatusCode::BAD_REQUEST, |
| 45 | CollectionsError::AlreadyExists(_) => StatusCode::CONFLICT, |
| 46 | CollectionsError::FailedToGetAppEnv => StatusCode::INTERNAL_SERVER_ERROR, |
| 47 | CollectionsError::FailedToCreateCollection(_) => StatusCode::BAD_REQUEST, |
| 48 | CollectionsError::WaCustomError(_) => StatusCode::INTERNAL_SERVER_ERROR, |
| 49 | CollectionsError::ServerError(_) => StatusCode::INTERNAL_SERVER_ERROR, |
| 50 | } |
| 51 | } |
| 52 | } |