use thiserror::Error;
#[derive(Debug, Clone, PartialEq, Eq, Error)]
pub enum AgentLibError {
#[error("invalid URL: {0}")]
InvalidUrl(String),
#[error("SSRF validation failed for {url}: {reason}")]
SsrfDenied {
url: String,
reason: String,
},
#[error("egress guard denied URL: {url}")]
EgressDenied {
url: String,
},
#[error("HTTP status {status} for {url}")]
HttpStatus {
status: u16,
url: String,
},
#[error("response exceeded max_bytes limit of {max_bytes}")]
MaxBytesExceeded {
max_bytes: usize,
},
#[error("request timed out: {0}")]
Timeout(String),
#[error("too many redirects (max {max_redirects})")]
TooManyRedirects {
max_redirects: u8,
},
#[error("network error: {0}")]
Network(String),
#[error("content extraction failed: {0}")]
Extraction(String),
#[error("markdown conversion failed: {0}")]
Markdown(String),
#[error("search failed: {0}")]
Search(String),
#[error("unsupported search provider: {0}")]
UnsupportedProvider(String),
#[error("internal error: {0}")]
Internal(String),
}