suricata_ipc/
errors.rs

1use thiserror::Error as ThisError;
2
3#[derive(Debug, ThisError)]
4pub enum Error {
5    #[error("IO Error: {0:?}")]
6    Io(#[from] std::io::Error),
7    #[error("Null pointer when dealing with ffi: {0:?}")]
8    Ffi(#[from] std::ffi::NulError),
9    #[error("Utf8 conversion error: {0:?}")]
10    Utf8(#[from] std::string::FromUtf8Error),
11    #[error("SystemTime error: {0:?}")]
12    SystemTime(#[from] std::time::SystemTimeError),
13    #[error("ParseInt error: {0:?}")]
14    ParseInt(#[from] std::num::ParseIntError),
15    #[error("Serde json conversion error: {0:?}")]
16    SerdeJson(#[from] serde_json::Error),
17    #[error("IPC error")]
18    PacketIpc(#[from] packet_ipc::Error),
19    #[error("No UDS connection formed")]
20    NoUDSConnection,
21    #[error("No rule found: {}:{}", gid, sid)]
22    RuleNotFound { gid: u64, sid: u64 },
23    #[error("Askama error: {0:?}")]
24    Askama(#[from] askama::Error),
25    #[error("MissingServerId: {0}")]
26    MissingServerId(usize),
27    #[error("Missing Include")]
28    MissingInclude,
29    #[error("{0}", msg)]
30    Custom { msg: String },
31}
32
33unsafe impl Sync for Error {}
34unsafe impl Send for Error {}