Skip to main content

archive_it_client/
error.rs

1use std::io;
2
3use reqwest::StatusCode;
4
5#[derive(Debug, thiserror::Error)]
6pub enum Error {
7    #[error("authenticated account list was empty")]
8    Empty,
9    #[error("invalid header {name}: {reason}")]
10    InvalidHeader { name: String, reason: String },
11    #[error("I/O failed: {0}")]
12    Io(#[from] io::Error),
13    #[error("resource not found: {0}")]
14    NotFound(String),
15    #[error("no primary WARC location for {filename}")]
16    PrimaryLocationMissing { filename: String },
17    #[error("HTTP request failed: {0}")]
18    Request(#[from] reqwest::Error),
19    #[error("unexpected status: {0}")]
20    Status(StatusCode),
21    #[error("invalid URL: {0}")]
22    Url(#[from] url::ParseError),
23}