1use std::fmt::Display;
2
3#[derive(Debug)]
7pub enum Error {
8 InternalServerError(String),
9}
10
11impl Display for Error {
12 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13 match self {
14 Error::InternalServerError(io_error) => write!(f, "{}", io_error),
15 }
16 }
17}
18
19impl std::error::Error for Error {}
20
21impl From<std::io::Error> for Error {
23 fn from(error: std::io::Error) -> Error {
24 Error::InternalServerError(error.to_string())
25 }
26}
27
28impl From<serde_yaml::Error> for Error {
30 fn from(error: serde_yaml::Error) -> Error {
31 Error::InternalServerError(error.to_string())
32 }
33}