odatav4_parser/
error.rs

1use thiserror::Error;
2
3/// Errors that can occur during OData V4 query parsing
4#[derive(Error, Debug, Clone, PartialEq)]
5pub enum ODataError {
6    #[error("Parse error at position {position}: {message}")]
7    ParseError { position: usize, message: String },
8
9    #[error("Unexpected end of input")]
10    UnexpectedEof,
11
12    #[error("Invalid number format: {0}")]
13    InvalidNumber(String),
14
15    #[error("Unexpected token at position {position}: expected {expected}, got {actual}")]
16    UnexpectedToken {
17        position: usize,
18        expected: String,
19        actual: String,
20    },
21
22    #[error("Unsupported query option: {0}")]
23    UnsupportedOption(String),
24}
25
26pub type Result<T> = std::result::Result<T, ODataError>;