1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Error types for the [`automaton`](`crate::automaton`) module.

use std::num::TryFromIntError;
use thiserror::Error;

/// Errors raised by the query compiler.
#[derive(Debug, Error)]
pub enum CompilerError {
    /// Max automaton size was exceeded during compilation of the query.
    #[error("Max automaton size was exceeded. Query is too complex.")]
    QueryTooComplex(#[source] Option<TryFromIntError>),

    /// Compiler error that occurred due to a known limitation.
    #[error(transparent)]
    NotSupported(#[from] crate::error::UnsupportedFeatureError),
}