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