diff options
author | Akshay <[email protected]> | 2021-10-19 11:28:46 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-10-19 11:28:46 +0100 |
commit | 214e3bc4b675b08ce4df76b1373f4548949e67ee (patch) | |
tree | db6584a360d69bc9759e2b8059a013ba9e8db5e1 /bin/src/err.rs | |
parent | 0076b3a37dcca0e11afd05dc98174f646cdb8fa9 (diff) |
fully flesh out CLI
Diffstat (limited to 'bin/src/err.rs')
-rw-r--r-- | bin/src/err.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/src/err.rs b/bin/src/err.rs new file mode 100644 index 0000000..b3a79c2 --- /dev/null +++ b/bin/src/err.rs | |||
@@ -0,0 +1,28 @@ | |||
1 | use std::{io, path::PathBuf}; | ||
2 | |||
3 | use globset::ErrorKind; | ||
4 | use rnix::parser::ParseError; | ||
5 | use thiserror::Error; | ||
6 | |||
7 | #[derive(Error, Debug)] | ||
8 | pub enum ConfigErr { | ||
9 | #[error("error parsing glob `{0:?}`: {1}")] | ||
10 | InvalidGlob(Option<String>, ErrorKind), | ||
11 | |||
12 | #[error("path error: {0}")] | ||
13 | InvalidPath(#[from] io::Error), | ||
14 | } | ||
15 | |||
16 | #[derive(Error, Debug)] | ||
17 | pub enum LintErr { | ||
18 | #[error("[{0}] syntax error: {1}")] | ||
19 | Parse(PathBuf, ParseError), | ||
20 | } | ||
21 | |||
22 | #[derive(Error, Debug)] | ||
23 | pub enum StatixErr { | ||
24 | #[error("linter error: {0}")] | ||
25 | Lint(#[from] LintErr), | ||
26 | #[error("config error: {0}")] | ||
27 | Config(#[from] ConfigErr), | ||
28 | } | ||