| 63 | .body(self.to_string()) |
| 64 | } |
| 65 | fn status_code(&self) -> StatusCode { |
| 66 | match self { |
| 67 | Self::NotFound => StatusCode::BAD_REQUEST, |
| 68 | Self::CollectionNotFound => StatusCode::BAD_REQUEST, |
| 69 | Self::FailedToGetAppEnv => StatusCode::INTERNAL_SERVER_ERROR, |
| 70 | Self::IndexNotFound => StatusCode::NOT_FOUND, |
| 71 | Self::FailedToCreateVector(_) => StatusCode::BAD_REQUEST, |
| 72 | Self::NotImplemented => StatusCode::BAD_REQUEST, |
| 73 | Self::DatabaseError(_) => StatusCode::INTERNAL_SERVER_ERROR, |
| 74 | Self::InternalServerError => StatusCode::INTERNAL_SERVER_ERROR, |
| 75 | Self::FailedToUpdateVector(_) => StatusCode::BAD_REQUEST, |
| 76 | Self::FailedToFindSimilarVectors(_) => StatusCode::BAD_REQUEST, |
| 77 | Self::FailedToDeleteVector(_) => StatusCode::BAD_REQUEST, |
| 78 | Self::WaCustom(_) => StatusCode::INTERNAL_SERVER_ERROR, |
| 79 | } |
| 80 | } |
| 81 | } |