Skip to main content

atlassian_rust_api/
error.rs

1use derive_more::From;
2
3pub type Result<T> = core::result::Result<T, Error>;
4
5#[derive(Debug, From)]
6pub enum Error {
7	#[from]
8	URLParseError(url::ParseError),
9	#[from]
10	ApiResponseError(reqwest::Error),
11	#[from]
12	JSONParseError(serde_json::Error),
13	UnsupportedOperation(reqwest::Method),
14}
15
16impl core::fmt::Display for Error {
17	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18		write!(f, "{self:?}")
19	}
20}
21
22impl std::error::Error for Error {}