openlegends_api/user/login/request/data/error.rs
1use std::fmt::{Display, Formatter, Result};
2
3#[derive(Debug)]
4pub enum Error {
5 Json(serde_json::Error),
6 Regex(regex::Error),
7}
8
9impl Display for Error {
10 fn fmt(&self, f: &mut Formatter) -> Result {
11 match self {
12 Self::Json(e) => write!(f, "JSON error: `{e}`"),
13 Self::Regex(e) => write!(f, "Could not parse regex expression `{e}`"),
14 }
15 }
16}