#[derive(thiserror::Error, Debug)]
pub enum UsptoApiError {
#[error("Invalid header value provided: {0}")]
InvalidHeaderValue(#[from] reqwest::header::InvalidHeaderValue),
#[error("A USPTO API key is required to make USPTO requests")]
MissingApiKey,
#[error("Error building the reqwest client: {0}")]
ClientBuildError(reqwest::Error),
#[error("Error sending request to USPTO API: {0}")]
SendError(reqwest::Error),
#[error("USPTO request failed with HTTP error code: {0}")]
HttpError(reqwest::Error),
#[error("Failed to read USPTO response: {0}")]
ResponseReadFailed(reqwest::Error),
#[error("Deserializing the USPTO's response JSON failed: {0}")]
JsonDeserializationFailed(#[from] serde_json::Error),
#[error("No results found for the input: {0}")]
NoSearchResults(String),
#[error("Failed to find a file URI in the USPTO API response")]
FileUriNotFound,
#[error("File I/O error: {0}")]
FileIoError(#[from] std::io::Error),
}