aboutsummaryrefslogtreecommitdiff
path: root/src/error.rs
blob: 8bc2225e358e3aa4ec6358ec454da4ed44f5323e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use thiserror::Error;

use std::io;

#[derive(Debug, Error)]
pub enum Error {
    #[error("bytes sent not equal to pkt size")]
    PartialSend,
    #[error("io: {0}")]
    Io(#[from] io::Error),
    #[error("serde_json: {0}")]
    SerdeJson(#[from] serde_json::Error),
    #[error("dns_message_parser decode: {0}")]
    DnsDecode(#[from] dns_message_parser::DecodeError),
    #[error("dns_message_parser encode: {0}")]
    DnsEncode(#[from] dns_message_parser::EncodeError),
    #[error("notify: {0}")]
    Notify(#[from] notify::Error),
    #[error("trust_dns_proto: {0}")]
    TrustDnsProto(#[from] trust_dns_proto::error::ProtoError),
}

pub type Result<T> = std::result::Result<T, Error>;