1use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum GrpcError {
7 #[error("grpc transport: {0}")]
8 Transport(String),
9 #[error("grpc http {status}: {body}")]
10 Http { status: u16, body: String },
11 #[error("grpc decode: {0}")]
12 Decode(String),
13 #[error("grpc method not found: {0}")]
14 NotFound(String),
15 #[error("grpc handler: {0}")]
16 Handler(String),
17 #[error("grpc rpc {code}: {message}")]
18 Rpc { code: String, message: String },
19 #[error("grpc plugin not installed")]
20 NotInstalled,
21}
22
23impl From<GrpcError> for sova_core::Error {
24 fn from(value: GrpcError) -> Self {
25 sova_core::Error::Internal(value.to_string())
26 }
27}