use serde::Deserialize;
#[derive(Debug, Deserialize)]
pub enum Error {
SerdeJson,
Base64,
}
impl From<serde_json::Error> for Error {
fn from(_: serde_json::Error) -> Self {
Error::SerdeJson
}
}
impl From<base64ct::Error> for Error {
fn from(_: base64ct::Error) -> Self {
Error::Base64
}
}
impl ToString for Error {
fn to_string(&self) -> String {
match self {
Error::SerdeJson => "Serde JSON Error".to_string(),
Error::Base64 => "Base64 Error".to_string(),
}
}
}