1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use std::{error::Error, fmt::Display};

#[derive(Debug)]
pub struct PhotonError {
    pub message: String,
}

impl PhotonError {
    pub fn new(message: &str) -> Self {
        PhotonError {
            message: message.to_string(),
        }
    }
}

impl Display for PhotonError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}", &self.message)
    }
}

impl Error for PhotonError {}