changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / rust/lib/dl/src/errors.rs

changeset 78: 966f92770ddf
parent: 97c99e44a22f
author: ellis <ellis@rwest.io>
date: Sun, 03 Dec 2023 23:25:08 -0500
permissions: -rw-r--r--
description: lisp groveling and rust fmt
1 use thiserror::Error;
2 
3 #[derive(Debug, Error)]
4 pub enum DownloadError {
5  #[error("http request returned an unsuccessful status code: {0}")]
6  HttpStatus(u32),
7  #[error("file not found")]
8  FileNotFound,
9  #[error("download backend '{0}' unavailable")]
10  BackendUnavailable(&'static str),
11  #[error("{0}")]
12  Message(String),
13  #[error(transparent)]
14  IoError(#[from] std::io::Error),
15  #[cfg(feature = "reqwest-backend")]
16  #[error(transparent)]
17  Reqwest(#[from] ::reqwest::Error),
18  #[cfg(feature = "curl-backend")]
19  #[error(transparent)]
20  CurlError(#[from] curl::Error),
21 }