(&self)
| 44 | } |
| 45 | |
| 46 | fn status_code(&self) -> StatusCode { |
| 47 | match self { |
| 48 | SearchError::CollectionNotFound(_) => StatusCode::NOT_FOUND, |
| 49 | SearchError::IndexNotFound(_) => StatusCode::BAD_REQUEST, |
| 50 | SearchError::InvalidFilter(_) => StatusCode::BAD_REQUEST, |
| 51 | SearchError::InternalServerError(_) => StatusCode::INTERNAL_SERVER_ERROR, |
| 52 | SearchError::WaCustom(_) => StatusCode::INTERNAL_SERVER_ERROR, |
| 53 | Self::InvalidInput(_) => StatusCode::BAD_REQUEST, |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | impl From<WaCustomError> for SearchError { |