ndn_app/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum AppError {
5    /// No Data arrived before the Interest timeout.
6    #[error("no data received for interest: timeout")]
7    Timeout,
8    /// The forwarder returned a Nack.
9    #[error("interest was nacked: {reason:?}")]
10    Nacked { reason: ndn_packet::NackReason },
11    /// An external [`ndn_ipc::ForwarderClient`] operation failed.
12    #[error("forwarder connection error: {0}")]
13    Connection(#[from] ndn_ipc::ForwarderError),
14    /// The in-process channel or external connection was closed.
15    #[error("connection closed")]
16    Closed,
17    /// A packet could not be decoded or a validation step failed.
18    #[error("protocol error: {0}")]
19    Protocol(String),
20}