1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, Error>;
7
8#[derive(Debug, Error)]
10pub enum Error {
11 #[error("invalid URL: {0}")]
13 InvalidUrl(String),
14
15 #[error("failed to create HTTP client: {0}")]
17 HttpClient(String),
18
19 #[error("HTTP request failed: {0}")]
21 HttpRequest(String),
22
23 #[error("HTTP error: status {0}")]
25 HttpStatus(u16),
26
27 #[error("site does not appear to be WordPress")]
29 NotWordPress,
30
31 #[error("invalid output format: '{0}' (valid: human, json, none)")]
33 InvalidOutputFormat(String),
34
35 #[error("invalid output detail: '{0}' (valid: all, nok)")]
37 InvalidOutputDetail(String),
38
39 #[error("invalid output sort: '{0}' (valid: status, name)")]
41 InvalidOutputSort(String),
42
43 #[error("output failed: {0}")]
45 OutputFailed(#[source] std::io::Error),
46
47 #[error("JSON serialization failed")]
49 SerializationFailed(#[from] serde_json::Error),
50}