wordpress_vulnerable_scanner/
error.rs1use std::io;
4use thiserror::Error;
5
6pub type Result<T> = std::result::Result<T, Error>;
8
9#[derive(Debug, Error)]
11pub enum Error {
12 #[error("invalid URL: {0}")]
14 InvalidUrl(String),
15
16 #[error("failed to create HTTP client: {0}")]
18 HttpClient(String),
19
20 #[error("HTTP request failed: {0}")]
22 HttpRequest(String),
23
24 #[error("HTTP error: status {0}")]
26 HttpStatus(u16),
27
28 #[error("failed to parse API response: {0}")]
30 ApiParse(String),
31
32 #[error("vulnerability API error: {0}")]
34 VulnApi(String),
35
36 #[error("no input provided: specify a URL, --plugins, --themes, --core, or --manifest")]
38 NoInput,
39
40 #[error("failed to read manifest file: {0}")]
42 ManifestRead(String),
43
44 #[error("failed to parse manifest file: {0}")]
46 ManifestParse(String),
47
48 #[error("invalid plugin format '{0}': expected 'slug:version' or 'slug'")]
50 InvalidPluginFormat(String),
51
52 #[error("invalid theme format '{0}': expected 'slug:version' or 'slug'")]
54 InvalidThemeFormat(String),
55
56 #[error("output failed: {0}")]
58 OutputFailed(#[from] io::Error),
59
60 #[error("JSON serialization failed: {0}")]
62 JsonSerialize(#[from] serde_json::Error),
63
64 #[error("invalid output format: {0}")]
66 InvalidOutputFormat(String),
67
68 #[error("invalid severity level: {0}")]
70 InvalidSeverity(String),
71}