rsonpath/automaton/
error.rs

1//! Error types for the [`automaton`](`crate::automaton`) module.
2
3use std::num::TryFromIntError;
4use thiserror::Error;
5
6/// Errors raised by the query compiler.
7#[derive(Debug, Error)]
8pub enum CompilerError {
9    /// Max automaton size was exceeded during compilation of the query.
10    #[error("Max automaton size was exceeded. Query is too complex.")]
11    QueryTooComplex(#[source] Option<TryFromIntError>),
12
13    /// Compiler error that occurred due to a known limitation.
14    #[error(transparent)]
15    NotSupported(#[from] crate::error::UnsupportedFeatureError),
16}