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

Method status_code

src/api/vectordb/indexes/error.rs:60–71  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

58 }
59
60 fn status_code(&self) -> StatusCode {
61 match self {
62 Self::NotFound(_) => StatusCode::NOT_FOUND,
63 Self::FailedToGetAppEnv => StatusCode::INTERNAL_SERVER_ERROR,
64 Self::CollectionNotFound => StatusCode::NOT_FOUND,
65 Self::FailedToCreateIndex(_) => StatusCode::BAD_REQUEST,
66 Self::IndexAlreadyExists(_) => StatusCode::CONFLICT,
67 Self::FailedToDeleteIndex(_) => StatusCode::INTERNAL_SERVER_ERROR,
68 Self::InvalidIndexType(_) => StatusCode::BAD_REQUEST,
69 Self::WaCustom(_) => StatusCode::INTERNAL_SERVER_ERROR,
70 }
71 }
72}
73
74impl From<WaCustomError> for IndexesError {

Callers 1

error_responseMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected