Skip to main content

protosocket_prost/
error.rs

1use std::sync::Arc;
2
3/// Result type for protosocket-prost.
4pub type Result<T> = std::result::Result<T, Error>;
5
6/// Error type for protosocket-prost.
7#[derive(Clone, Debug, thiserror::Error)]
8pub enum Error {
9    /// A standard IO failure
10    #[error("IO failure: {0}")]
11    IoFailure(#[from] Arc<std::io::Error>),
12    /// An address parse error
13    #[error("Bad address: {0}")]
14    AddressError(#[from] core::net::AddrParseError),
15    /// Something fatal with the connection
16    #[error("Requested resource was unable to respond: ({0})")]
17    Dead(&'static str),
18}