pub enum EngineError {
InputError(InputError),
SinkError(Box<dyn Error + Send + Sync>),
DepthBelowZero(usize, DepthError),
DepthAboveLimit(usize, DepthError),
MissingClosingCharacter(),
MissingOpeningCharacter(),
MissingItem(),
MalformedStringQuotes(usize),
NotSupported(UnsupportedFeatureError),
InternalError(InternalRsonpathError),
}
Expand description
Error enum for all types of errors that can be reported during engine execution.
NOTE: Most errors are not guaranteed to be raised for every JSON document that is malformed in the respective manner. The engine may ignore such errors and simply produce incorrect results for invalid documents.
Variants§
InputError(InputError)
Error while reading from the supplied Input
implementation.
SinkError(Box<dyn Error + Send + Sync>)
Error while writing to the supplied Sink
implementation.
DepthBelowZero(usize, DepthError)
Document depth fell below zero, which can only happen
if there are more closing than opening braces.
The inner usize
value indicates the position of the mismatched closing character.
DepthAboveLimit(usize, DepthError)
The depth limit was reached – the document is too nested.
The inner usize
value indicates the position of the opening character
which caused the overflow.
MissingClosingCharacter()
The engine reached end of the document while depth was positive. This means that some of the opening characters do not have matching closing characters.
MissingOpeningCharacter()
The engine reached a structural character that should occur only in an object or list, but there was no preceding opening character.
MissingItem()
The engine found a query match, but no value associated with it.
MalformedStringQuotes(usize)
An error occurred when trying to parse a member name terminated by a particular colon character.
The inner usize
value should be set to the byte index of the colon.
NotSupported(UnsupportedFeatureError)
Engine error that occurred due to a known limitation.
InternalError(InternalRsonpathError)
Irrecoverable error due to a broken invariant or assumption. The engine returns these instead of panicking.