noa_parser/errors.rs
1//! Error types
2/// The result of a parse operation
3pub type ParseResult<T> = Result<T, ParseError>;
4
5#[derive(Debug, thiserror::Error)]
6pub enum ParseError {
7 #[error("Unexpected end of input")]
8 UnexpectedEndOfInput,
9 #[error("Unexpected token have been encountered")]
10 UnexpectedToken,
11 #[error("UTF-8 error: {0}")]
12 Utf8Error(#[from] std::str::Utf8Error),
13 #[error("ParseIntError: {0}")]
14 ParseIntError(#[from] std::num::ParseIntError),
15}