ipfs_api_prelude/
error.rs1use std::{io, string::FromUtf8Error};
10use thiserror::Error;
11
12#[derive(Debug, Error)]
13pub enum Error {
14 #[error("io error `{0}`")]
15 Io(#[from] io::Error),
16
17 #[error("utf8 decoding error `{0}`")]
18 ParseUtf8(#[from] FromUtf8Error),
19
20 #[error("json decoding error `{0}`")]
21 Parse(#[from] serde_json::Error),
22
23 #[error("uri error `{0}`")]
24 Url(#[from] http::uri::InvalidUri),
25
26 #[error("url encoding error `{0}`")]
27 EncodeUrl(#[from] serde_urlencoded::ser::Error),
28
29 #[error("api returned an error while streaming `{0}`")]
30 StreamError(String),
31
32 #[error("api got unrecognized trailer header `{0}`")]
33 UnrecognizedTrailerHeader(String),
34
35 #[error("api returned an unknown error `{0}`")]
36 UnrecognizedApiError(String),
37}