openlegends_client/server/status/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use openlegends_server::api::server::*;
use std::fmt::{Display, Formatter, Result};

#[derive(Debug)]
pub enum Error {
    Connection(crate::connection::Error),
    Response(status::response::Error),
}

impl Display for Error {
    fn fmt(&self, f: &mut Formatter) -> Result {
        match self {
            Self::Connection(e) => {
                write!(f, "Connection error: `{e}`")
            }
            Self::Response(e) => {
                write!(f, "Response error: `{e}`")
            }
        }
    }
}