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

Method from

src/grpc/error.rs:5–21  ·  view source on GitHub ↗
(error: WaCustomError)

Source from the content-addressed store, hash-verified

3
4impl From<WaCustomError> for Status {
5 fn from(error: WaCustomError) -> Self {
6 match error {
7 WaCustomError::InvalidParams => Status::invalid_argument(error.to_string()),
8 WaCustomError::NotFound(msg) => Status::not_found(msg),
9 WaCustomError::FsError(msg) => Status::internal(format!("Filesystem error: {}", msg)),
10 WaCustomError::DatabaseError(msg) => {
11 Status::internal(format!("Database error: {}", msg))
12 }
13 WaCustomError::SerializationError(msg) => {
14 Status::internal(format!("Serialization error: {}", msg))
15 }
16 WaCustomError::DeserializationError(msg) => {
17 Status::internal(format!("Deserialization error: {}", msg))
18 }
19 _ => Status::internal(error.to_string()),
20 }
21 }
22}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected