16 lines
560 B
Rust
16 lines
560 B
Rust
pub type RpcResult<T> = Result<T, RpcError>;
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum RpcError {
|
|
#[error("transport: {0}")]
|
|
Transport(#[from] std::io::Error),
|
|
#[error("encoding: {0}")]
|
|
Encoding(#[from] serde_json::Error),
|
|
#[error("frame of {actual} byte(s) exceeds the {limit} byte limit")]
|
|
FrameTooLarge { actual: usize, limit: usize },
|
|
#[error("peer closed the connection")]
|
|
Closed,
|
|
#[error("service rejected the call: {0}")]
|
|
Rejected(String),
|
|
#[error("service is unavailable: {0}")]
|
|
Unavailable(String),
|
|
}
|