diff options
Diffstat (limited to 'bin/src/err.rs')
-rw-r--r-- | bin/src/err.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bin/src/err.rs b/bin/src/err.rs index 727e0cc..5f71b57 100644 --- a/bin/src/err.rs +++ b/bin/src/err.rs | |||
@@ -8,9 +8,10 @@ use thiserror::Error; | |||
8 | pub enum ConfigErr { | 8 | pub enum ConfigErr { |
9 | #[error("error parsing glob `{0:?}`: {1}")] | 9 | #[error("error parsing glob `{0:?}`: {1}")] |
10 | InvalidGlob(Option<String>, ErrorKind), | 10 | InvalidGlob(Option<String>, ErrorKind), |
11 | |||
12 | #[error("path error: {0}")] | 11 | #[error("path error: {0}")] |
13 | InvalidPath(#[from] io::Error), | 12 | InvalidPath(#[from] io::Error), |
13 | #[error("unable to parse `{0}` as line and column")] | ||
14 | InvalidPosition(String) | ||
14 | } | 15 | } |
15 | 16 | ||
16 | #[derive(Error, Debug)] | 17 | #[derive(Error, Debug)] |
@@ -28,11 +29,25 @@ pub enum FixErr { | |||
28 | } | 29 | } |
29 | 30 | ||
30 | #[derive(Error, Debug)] | 31 | #[derive(Error, Debug)] |
32 | pub enum SingleFixErr { | ||
33 | #[error("path error: {0}")] | ||
34 | InvalidPath(#[from] io::Error), | ||
35 | #[error("position out of bounds: line {0}, col {1}")] | ||
36 | OutOfBounds(usize, usize), | ||
37 | #[error("{0} is too large")] | ||
38 | Conversion(usize), | ||
39 | #[error("nothing to fix")] | ||
40 | NoOp, | ||
41 | } | ||
42 | |||
43 | #[derive(Error, Debug)] | ||
31 | pub enum StatixErr { | 44 | pub enum StatixErr { |
32 | #[error("linter error: {0}")] | 45 | #[error("linter error: {0}")] |
33 | Lint(#[from] LintErr), | 46 | Lint(#[from] LintErr), |
34 | #[error("fixer error: {0}")] | 47 | #[error("fixer error: {0}")] |
35 | Fix(#[from] FixErr), | 48 | Fix(#[from] FixErr), |
49 | #[error("single fix error: {0}")] | ||
50 | Single(#[from] SingleFixErr), | ||
36 | #[error("config error: {0}")] | 51 | #[error("config error: {0}")] |
37 | Config(#[from] ConfigErr), | 52 | Config(#[from] ConfigErr), |
38 | } | 53 | } |