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

Method status_code

src/api/vectordb/search/error.rs:46–55  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

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
58impl From<WaCustomError> for SearchError {

Callers 1

error_responseMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected