offline_protocol_reliability/error.rs
1//! Reliability layer errors.
2
3use thiserror::Error;
4
5/// Result type alias.
6pub type Result<T> = std::result::Result<T, Error>;
7
8/// Reliability layer errors.
9// Adding a variant to a public error enum is a breaking change without
10// this attribute; downstream crates must carry a wildcard arm.
11#[non_exhaustive]
12#[derive(Debug, Error)]
13pub enum Error {
14 /// ACK timeout.
15 #[error("ACK timeout for message {0}")]
16 AckTimeout(String),
17
18 /// Core error.
19 #[error("Core error: {0}")]
20 Core(#[from] offline_protocol_core::Error),
21
22 /// Generic error.
23 #[error("{0}")]
24 Other(String),
25}