photon_geocoding/
error.rs

1use std::{error::Error, fmt::Display};
2
3#[derive(Debug)]
4pub struct PhotonError {
5    pub message: String,
6}
7
8impl PhotonError {
9    pub fn new(message: &str) -> Self {
10        PhotonError {
11            message: message.to_string(),
12        }
13    }
14}
15
16impl Display for PhotonError {
17    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18        write!(f, "{}", &self.message)
19    }
20}
21
22impl Error for PhotonError {}