ddapi_rs/error.rs
1#[derive(Debug)]
2pub enum ApiError {
3 NotFound,
4 Other(String),
5}
6
7impl std::fmt::Display for ApiError {
8 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9 match self {
10 ApiError::NotFound => write!(f, "Player not found"),
11 ApiError::Other(msg) => write!(f, "{}", msg),
12 }
13 }
14}
15
16impl std::error::Error for ApiError {}