aboutsummaryrefslogtreecommitdiff
path: root/bin/src/err.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-10-19 11:28:46 +0100
committerAkshay <[email protected]>2021-10-19 11:28:46 +0100
commit214e3bc4b675b08ce4df76b1373f4548949e67ee (patch)
treedb6584a360d69bc9759e2b8059a013ba9e8db5e1 /bin/src/err.rs
parent0076b3a37dcca0e11afd05dc98174f646cdb8fa9 (diff)
fully flesh out CLI
Diffstat (limited to 'bin/src/err.rs')
-rw-r--r--bin/src/err.rs28
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 @@
1use std::{io, path::PathBuf};
2
3use globset::ErrorKind;
4use rnix::parser::ParseError;
5use thiserror::Error;
6
7#[derive(Error, Debug)]
8pub 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)]
17pub enum LintErr {
18 #[error("[{0}] syntax error: {1}")]
19 Parse(PathBuf, ParseError),
20}
21
22#[derive(Error, Debug)]
23pub enum StatixErr {
24 #[error("linter error: {0}")]
25 Lint(#[from] LintErr),
26 #[error("config error: {0}")]
27 Config(#[from] ConfigErr),
28}