Skip to main content

mdlint/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum MarkdownlintError {
5    #[error("Configuration error: {0}")]
6    Config(String),
7
8    #[error("IO error: {0}")]
9    Io(#[from] std::io::Error),
10
11    #[error("Invalid glob pattern: {0}")]
12    InvalidGlob(String),
13
14    #[error("Invalid regex pattern: {0}")]
15    InvalidRegex(#[from] regex::Error),
16
17    #[error("Parse error: {0}")]
18    Parse(String),
19
20    #[error("Fix error: {0}")]
21    Fix(String),
22}
23
24pub type Result<T> = std::result::Result<T, MarkdownlintError>;