md_todo/error.rs
1use thiserror::Error;
2
3/// Possible errors in this library.
4#[derive(Error, Debug)]
5pub enum MDTodoError {
6 /// Issue while parsing the todo.
7 #[error("Issue parsing a todo")]
8 TodoParseError,
9
10 /// Represents a failure to read from input.
11 #[error("Read error")]
12 FileReadError { source: std::io::Error },
13
14 /// The file changed since it was last read
15 #[error("File changed error")]
16 FileChanged,
17
18 /// Not a directory
19 #[error("Not a valid path or existing directory")]
20 NotADir,
21
22 /// Represents all other cases of `std::io::Error`.
23 #[error(transparent)]
24 IOError(#[from] std::io::Error),
25}