1use core::fmt;
2
3#[derive(Debug)]
5pub struct Error {
6 kind: ErrorKind,
7}
8
9#[derive(Debug)]
10enum ErrorKind {
11 Yaml(serde_yaml::Error),
12}
13
14impl Error {
15 pub(crate) fn from_yaml(err: serde_yaml::Error) -> Self {
16 Self {
17 kind: ErrorKind::Yaml(err),
18 }
19 }
20}
21
22impl fmt::Display for Error {
23 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
24 match &self.kind {
25 ErrorKind::Yaml(err) => write!(f, "{}", err),
26 }
27 }
28}
29
30impl std::error::Error for Error {}