use std::io;
use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Error)]
pub enum Error {
#[error("invalid URL: {0}")]
InvalidUrl(String),
#[error("failed to create HTTP client: {0}")]
HttpClient(String),
#[error("HTTP request failed: {0}")]
HttpRequest(String),
#[error("HTTP error: status {0}")]
HttpStatus(u16),
#[error("failed to parse API response: {0}")]
ApiParse(String),
#[error("vulnerability API error: {0}")]
VulnApi(String),
#[error("no input provided: specify a URL, --plugins, --themes, --core, or --manifest")]
NoInput,
#[error("failed to read manifest file: {0}")]
ManifestRead(String),
#[error("failed to parse manifest file: {0}")]
ManifestParse(String),
#[error("invalid plugin format '{0}': expected 'slug:version' or 'slug'")]
InvalidPluginFormat(String),
#[error("invalid theme format '{0}': expected 'slug:version' or 'slug'")]
InvalidThemeFormat(String),
#[error("output failed: {0}")]
OutputFailed(#[from] io::Error),
#[error("JSON serialization failed: {0}")]
JsonSerialize(#[from] serde_json::Error),
#[error("invalid output format: {0}")]
InvalidOutputFormat(String),
#[error("invalid severity level: {0}")]
InvalidSeverity(String),
}