1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Error types for the web-analyzer crate.
/// Errors that can occur during web analysis operations.
#[derive(Debug, thiserror::Error)]
pub enum WebAnalyzerError {
/// An HTTP request failed.
#[error("HTTP request failed: {0}")]
Http(#[from] reqwest::Error),
/// DNS resolution failed for a target domain.
#[error("DNS resolution failed for {domain}: {detail}")]
Dns {
/// The domain that failed to resolve.
domain: String,
/// Details about the failure.
detail: String,
},
/// An external tool (dig, nmap, subfinder, etc.) was not found or failed.
#[error("External tool '{tool}' failed: {detail}")]
ExternalTool {
/// Name of the tool (e.g. "dig", "nmap", "subfinder").
tool: String,
/// Details about the failure.
detail: String,
},
/// An operation timed out.
#[error("Timeout: {0}")]
Timeout(String),
/// A parsing error occurred while processing output.
#[error("Parse error: {0}")]
Parse(String),
/// JSON serialization/deserialization error.
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
/// A generic error for uncategorized failures.
#[error("{0}")]
Other(String),
/// A feature was invoked on an incompatible operating system architecture.
#[error("Platform unsupported: {0}")]
UnsupportedPlatform(String),
}
/// Convenience alias for `Result<T, WebAnalyzerError>`.
pub type Result<T> = std::result::Result<T, WebAnalyzerError>;