matrix_oracle/server/
error.rs1pub type Result<T> = std::result::Result<T, Error>;
5
6#[derive(Debug)]
8pub enum Error {
9 Http(reqwest::Error),
11}
12
13impl std::fmt::Display for Error {
14 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15 match self {
16 Self::Http(http) => write!(f, "{}", http),
17 }
18 }
19}
20
21impl std::error::Error for Error {
22 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
23 match *self {
24 Self::Http(ref err) => Some(err),
25 }
26 }
27}
28
29impl From<reqwest::Error> for Error {
30 fn from(err: reqwest::Error) -> Self {
31 Self::Http(err)
32 }
33}