Skip to main content

offline_protocol_services/
error.rs

1/// Errors from mesh service operations.
2// Adding a variant to a public error enum is a breaking change without
3// this attribute; downstream crates must carry a wildcard arm.
4#[non_exhaustive]
5#[derive(Debug, thiserror::Error)]
6pub enum ServiceError {
7    /// Serialization or deserialization failed.
8    #[error("serialization error: {0}")]
9    Serialization(String),
10
11    /// A payload field exceeds its maximum allowed size.
12    #[error("payload too large: {0}")]
13    PayloadTooLarge(String),
14
15    /// An invalid service response status was provided.
16    #[error("invalid status: {0} (expected one of: ok, not_found, error)")]
17    InvalidStatus(String),
18
19    /// Other service error.
20    #[error("{0}")]
21    Other(String),
22}