1use miette::SourceSpan;
2
3#[derive(Debug)]
4#[derive(miette::Diagnostic)]
5#[derive(thiserror::Error)]
6pub enum PathError {
7 #[error("Path can only contain A..Z, a..z, 0..9 or _")]
8 Alphanumeric {
9 #[label]
10 path: SourceSpan,
11 },
12 #[error("Path is empty")]
13 Empty {
14 #[label]
15 path: SourceSpan,
16 },
17 #[error("Path cannot end with a dot")]
18 EndWithDot {
19 #[label]
20 path: SourceSpan,
21 },
22 #[error("Path component must start with A..Z, a..z or _")]
23 Start {
24 #[label]
25 path: SourceSpan,
26 },
27}