lnmp_net/
error.rs

1//! Error types for LNMP-Net
2
3use thiserror::Error;
4
5/// Result type for LNMP-Net operations
6pub type Result<T> = std::result::Result<T, NetError>;
7
8/// Errors that can occur in LNMP-Net operations
9#[derive(Debug, Error)]
10pub enum NetError {
11    /// Timestamp is required for TTL-based operations but is missing
12    #[error("Missing timestamp in envelope metadata (required for TTL checks)")]
13    MissingTimestamp,
14
15    /// Invalid priority value
16    #[error("Invalid priority value: {0}")]
17    InvalidPriority(String),
18
19    /// Invalid TTL value
20    #[error("Invalid TTL value: {0}")]
21    InvalidTTL(String),
22
23    /// Envelope validation error
24    #[error("Envelope error: {0}")]
25    EnvelopeError(#[from] lnmp_envelope::EnvelopeError),
26
27    /// Generic error
28    #[error("{0}")]
29    Other(String),
30}