wildland_http_client/error.rs
1//
2// Wildland Project
3//
4// Copyright © 2022 Golem Foundation
5//
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License version 3 as published by
8// the Free Software Foundation.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <https://www.gnu.org/licenses/>.
17
18use std::rc::Rc;
19
20use thiserror::Error;
21use wildland_crypto::error::CryptoError;
22
23use crate::cross_platform_http_client::HttpError;
24
25#[derive(Error, Debug, Clone)]
26#[repr(C)]
27pub enum WildlandHttpClientError {
28 #[error("{0}")]
29 HttpError(String),
30 #[error("Cannot serialize request - source: {0}")]
31 CannotSerializeRequestError(#[from] Rc<serde_json::Error>),
32 #[error(transparent)]
33 CommonLibError(#[from] CryptoError),
34 #[error(transparent)]
35 HttpLibError(#[from] HttpError),
36}