cobble_core/error/
download_error.rs1pub type DownloadResult<T> = Result<T, DownloadError>;
3
4#[derive(Debug, thiserror::Error)]
6pub enum DownloadError {
7 #[error("{0}")]
9 Request(reqwest::Error),
10 #[error("The request response could not provide a content-length")]
12 NoContentLength,
13 #[error("{0}")]
15 Io(std::io::Error),
16 #[error("The Checksums do not match")]
18 ChecksumMismatch,
19}
20
21impl From<reqwest::Error> for DownloadError {
22 fn from(err: reqwest::Error) -> Self {
23 Self::Request(err)
24 }
25}
26
27impl From<std::io::Error> for DownloadError {
28 fn from(err: std::io::Error) -> Self {
29 Self::Io(err)
30 }
31}