seer_core/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum SeerError {
5    #[error("WHOIS lookup failed: {0}")]
6    WhoisError(String),
7
8    #[error("WHOIS server not found for TLD: {0}")]
9    WhoisServerNotFound(String),
10
11    #[error("WHOIS connection failed: {0}")]
12    WhoisConnectionFailed(#[from] std::io::Error),
13
14    #[error("RDAP lookup failed: {0}")]
15    RdapError(String),
16
17    #[error("RDAP bootstrap failed: {0}")]
18    RdapBootstrapError(String),
19
20    #[error("DNS resolution failed: {0}")]
21    DnsError(String),
22
23    #[error("DNS resolver error: {0}")]
24    DnsResolverError(#[from] hickory_resolver::error::ResolveError),
25
26    #[error("Invalid domain name: {0}")]
27    InvalidDomain(String),
28
29    #[error("Invalid IP address: {0}")]
30    InvalidIpAddress(String),
31
32    #[error("Invalid record type: {0}")]
33    InvalidRecordType(String),
34
35    #[error("HTTP request failed: {0}")]
36    HttpError(String),
37
38    #[error("Reqwest error: {0}")]
39    ReqwestError(#[from] reqwest::Error),
40
41    #[error("JSON parsing failed: {0}")]
42    JsonError(#[from] serde_json::Error),
43
44    #[error("Timeout: {0}")]
45    Timeout(String),
46
47    #[error("Rate limited: {0}")]
48    RateLimited(String),
49
50    #[error("Certificate error: {0}")]
51    CertificateError(String),
52
53    #[error("Bulk operation failed: {context}")]
54    BulkOperationError {
55        context: String,
56        failures: Vec<(String, String)>,
57    },
58
59    #[error("{0}")]
60    Other(String),
61}
62
63pub type Result<T> = std::result::Result<T, SeerError>;