Skip to main content

etcd_rs/
error.rs

1use crate::proto::etcdserverpb;
2
3#[derive(thiserror::Error, Debug)]
4pub enum Error {
5    #[error("io error")]
6    IOError(#[from] std::io::Error),
7    #[error("invalid URI")]
8    InvalidURI(#[from] http::uri::InvalidUri),
9    #[error("gRPC transport error")]
10    Transport(#[from] tonic::transport::Error),
11    #[error("response failed")]
12    Response(#[from] tonic::Status),
13    #[error("channel closed")]
14    ChannelClosed,
15    #[error("failed to create watch")]
16    CreateWatch,
17    #[error("unexpected watch event")]
18    WatchEvent(String),
19    #[error("failed to keep alive lease")]
20    KeepAliveLease,
21    #[error("watch channel send error")]
22    WatchChannelSend(#[from] tokio::sync::mpsc::error::SendError<etcdserverpb::WatchRequest>),
23    #[error("watch event exhausted")]
24    WatchEventExhausted,
25}