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

Method status_code

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

Source from the content-addressed store, hash-verified

58 .body(self.to_string())
59 }
60 fn status_code(&self) -> StatusCode {
61 match self {
62 Self::NotFound => StatusCode::BAD_REQUEST,
63 Self::CollectionNotFound => StatusCode::BAD_REQUEST,
64 Self::IndexNotFound => StatusCode::BAD_REQUEST,
65 Self::FailedToGetAppEnv => StatusCode::INTERNAL_SERVER_ERROR,
66 Self::FailedToGetTransactionStatus(_) => StatusCode::BAD_REQUEST,
67 Self::FailedToCreateTransaction(_) => StatusCode::BAD_REQUEST,
68 Self::FailedToCommitTransaction(_) => StatusCode::BAD_REQUEST,
69 Self::OnGoingTransaction => StatusCode::CONFLICT,
70 Self::NotImplemented => StatusCode::BAD_REQUEST,
71 Self::FailedToCreateVector(_) => StatusCode::BAD_REQUEST,
72 Self::FailedToDeleteVector(_) => StatusCode::BAD_REQUEST,
73 }
74 }
75}

Callers 1

error_responseMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected