workout_note_parser/
error.rs

1use crate::Rule;
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5pub enum Error {
6    #[error("Unexpected rule: {0:?}")]
7    UnexpectedRule(Rule),
8
9    #[error("Expected rule: {0:?}")]
10    ExpectedRule(Rule),
11
12    #[error(transparent)]
13    ParsingError(#[from] Box<pest::error::Error<Rule>>),
14
15    #[error(transparent)]
16    ParseIntError(#[from] std::num::ParseIntError),
17
18    #[error(transparent)]
19    ParseFloatError(#[from] std::num::ParseFloatError),
20}