reda_lib/
error.rs

1
2#[derive(Debug, thiserror::Error)]
3pub enum LibError {
4    #[error("except group")]
5    ExceptGroup,
6
7    #[error("library param should only a name")]
8    LibraryParamLenUnmatch,
9
10    #[error("expect attr {0} but not found")]
11    MissAttr(String),
12
13    #[error("unsupport direction literal {0}")]
14    UnsupportDirection(String),
15
16    #[error(transparent)]
17    Io(#[from] std::io::Error),
18
19    #[error("parse error: {0}")]
20    Parse(String),
21
22    #[error("value kind unmatch, expect {0} but got {1}")]
23    ValueKindUnmatch(&'static str, &'static str),
24}
25
26pub type LibResult<T> = Result<T, LibError>;