use crate::{
error::{DepthError, InternalRsonpathError},
input::error::InputError,
};
use thiserror::Error;
#[derive(Debug, Error)]
pub enum EngineError {
#[error(transparent)]
InputError(#[from] InputError),
#[error("Error writing a result to sink: '{0}'")]
SinkError(#[source] Box<dyn std::error::Error + Send + Sync>),
#[error("Mismatched closing character in the input JSON at position {0}.")]
DepthBelowZero(usize, #[source] DepthError),
#[error("Opening character at position {0} caused depth overflow.")]
DepthAboveLimit(usize, #[source] DepthError),
#[error("Malformed input JSON; end of input was reached, but unmatched opening characters remained.")]
MissingClosingCharacter(),
#[error("Malformed input JSON; structural characters present, but no opening character read.")]
MissingOpeningCharacter(),
#[error("Malformed input JSON; a query match was found, but there was no associated value")]
MissingItem(),
#[error(
"Malformed member name in the input JSON; \
the colon at position {0} must be preceded by a string, but \
there are no matching double quote characters."
)]
MalformedStringQuotes(usize),
#[error(transparent)]
NotSupported(#[from] crate::error::UnsupportedFeatureError),
#[error("EngineError: {0}")]
InternalError(
#[source]
#[from]
InternalRsonpathError,
),
}