MCPcopy Create free account
hub / github.com/cosdata/cosdata / status_code

Method status_code

src/api/vectordb/vectors/error.rs:65–80  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

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}

Callers 1

error_responseMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected