pub enum Error {
Show 22 variants
Syntax(String),
Semantic(String),
ArgumentError(String),
ArgumentValue {
kind: ErrorKind,
detail: String,
},
UniquenessViolation {
name: String,
},
ConstraintCreationFailed {
detail: String,
},
ProcedureNotFound {
name: String,
},
InvalidArgumentType(String),
TypeError(String),
ParameterMissing(String),
DatabaseNotFound {
name: String,
},
Type(String),
Arithmetic(ArithmeticFailure),
Execution(String),
Cancelled,
Conflict,
Capacity {
used: u64,
limit: u64,
kind: CapacityKind,
},
ResourceLimit {
name: &'static str,
limit: u64,
retryable: bool,
receipt: Option<ExecutionReceipt>,
},
Storage(String),
Locked(String),
Io(String),
Internal(String),
}Variants§
Syntax(String)
Semantic(String)
ArgumentError(String)
An argument-value rejection carrying Neo4j’s ArgumentError class
(ADR-0489): a schema DDL command’s OPTIONS/indexConfig value that
the argument validator refuses. The class travels as data so no
surface has to scan the rendered text for a prefix. Display keeps the
historical semantic error: <detail> rendering, so only the class
moves, never the detail text.
ArgumentValue
An argument-value rejection discovered while producing rows — the
function-argument validator’s, carrying Neo4j’s ArgumentError class
under its Neo.ClientError.Statement.ArgumentError code (22N03). The
class matches Self::ArgumentError’s; the stage does not — live
fails the PULL, not the RUN, so the two cannot share one variant.
The kind and the detail travel as data, so a consumer reads the
token (Error::typed_detail) instead of parsing the rendered
message. Covers the kind-carrying PULL-time validator sites only:
range()’s zero step, the substring()/left()/right() range
rejections, list-slice bounds, point()’s in-map values, bar()‘s
width and the percentile aggregates’ argument. The plain-detail
PULL-time Self::ArgumentError sites (the temporal constructors,
point_component(), the regex compile failures and the fulltext
analyzer option) are not migrated here: they carry ADR-0489’s
InvalidArguments class today, and moving them would change the
Neo4j code they report. They stay a separate decision (ADR-0559).
UniquenessViolation
A uniqueness-constraint violation raised by constraint validation,
carrying the violated constraint’s name typed, so consumers match the
class and read the name without parsing the rendered message. The
Display text is byte-identical to the historical
Semantic("ConstraintValidationFailed: uniqueness")
rendering — stored text, bindings classification and pinned messages
do not move.
ConstraintCreationFailed
A constraint the statement created (or re-derived) failed its data
check, carrying the wrapped rule failure’s bare detail. The creation
condition is a documented GQLSTATUS (50N11) of its own and outranks
the rule failure’s class, so it travels typed — the classifier reads
the variant, never a token recovered from the rendered text. The
Display text is byte-identical to the historical
Semantic("ConstraintCreationFailed: <detail>") rendering — stored
text, bindings classification and pinned messages do not move.
ProcedureNotFound
A call to a procedure the engine does not register (ADR-0138),
carrying the missing procedure’s name typed, so consumers match the
class without a prefix check on the rendered message. The Display
text is byte-identical to the historical
Syntax("ProcedureNotFound: <name>") rendering — pinned messages do
not move.
InvalidArgumentType(String)
An argument of the wrong static or runtime type, carrying the detail
text typed, so consumers match the class without scanning the
rendered message. The Display text is byte-identical to the
historical Type("InvalidArgumentType: <detail>") rendering.
TypeError(String)
A runtime type failure raised under the legacy TypeError detail
name, carrying the detail text typed. The Display text is
byte-identical to the historical Type("TypeError: <detail>")
rendering.
ParameterMissing(String)
A reference to a query parameter that was not supplied, carrying the
detail text typed. The Display text is byte-identical to the
historical Semantic("ParameterMissing: <detail>") rendering.
DatabaseNotFound
A selected database or USE target that is not one of the fixed
namespaces (ADR-0146, ADR-0307), carrying the name typed. The
Display text is byte-identical to the historical
Semantic("DatabaseNotFound: Graph not found: <name>") rendering.
Type(String)
Arithmetic(ArithmeticFailure)
An arithmetic failure raised while evaluating an expression
(ADR-0307). The Display text is the historical rendering of each
ArithmeticFailure, composed here from the shared Type-class
prefix (ADR-0338).
Execution(String)
Failure raised while evaluating an already parsed and planned query. The wrapped text preserves the executor’s typed detail.
Cancelled
A statement stopped through its crate::CancelToken (ADR-0111,
ADR-0307). The Display text is byte-identical to the historical
Execution("query cancelled") rendering.
Conflict
Capacity
A capacity refusal. kind selects the user-facing detail: the
graph-cap contract line (capacity exceeded: used=… limit=…,
ADR-0042/ADR-0307), the ADR-0463 expression-allocation line, or
the ADR-0494 per-record WAL payload cap line, the last two in
plain language. All three keep this variant so every surface’s
status mapping is one memory/capacity class.
ResourceLimit
A processing control refused work. name is
Error::CONCURRENT_LOGICAL_WORKSPACE_LIMIT.
retryable is false when the same call will fail again. receipt
is the logical bytes counted when admission produced the error.
Storage(String)
Locked(String)
A persistent database is already owned by another independent opener.
Io(String)
Internal(String)
Engine-internal failure that is not the query’s fault: worker-thread spawn failure or a panic observed across the worker join (ADR-0259). Always recoverable by the caller; never an abort.
Implementations§
Source§impl Error
impl Error
Sourcepub const CONCURRENT_LOGICAL_WORKSPACE_LIMIT: &'static str = "concurrent-logical-workspace-limit"
pub const CONCURRENT_LOGICAL_WORKSPACE_LIMIT: &'static str = "concurrent-logical-workspace-limit"
ResourceLimit::name for the concurrent logical-workspace admission
control. limit is the pool capacity in logical bytes.
Sourcepub const WRITER_DRAINING: &'static str = "writer-draining"
pub const WRITER_DRAINING: &'static str = "writer-draining"
ResourceLimit::name for a writer mid-demote (ADR-0440): new
writes are refused while commits already past admission finish and
the handle checkpoints before releasing the writer lease. Always
retryable: true — the caller retries once the follower that is
about to be promoted takes over.
Sourcepub const FOLLOW_GAP: &'static str = "follow-gap"
pub const FOLLOW_GAP: &'static str = "follow-gap"
ResourceLimit::name for a follower that yielded across a checkpoint
gap (ADR-0441). Always retryable: true. The host drops this engine
and opens a new one; this process does not load a second graph.
Sourcepub const WAL_PAYLOAD_CAP_BYTES: u64
pub const WAL_PAYLOAD_CAP_BYTES: u64
The per-record WAL payload cap (ADR-0086): one commit record whose
serialized JSON crosses this many bytes is refused with
Self::Capacity in the CapacityKind::WalPayload kind
(ADR-0494) before any frame is written. The one source of the
number — the refusal carries it as limit, and the storage
crate’s WAL encoder and scanner both consume it, so the rendered
message, the write refusal and the recovery bound cannot drift
apart (ADR-0492).
pub fn syntax(msg: impl Into<String>) -> Self
pub fn semantic(msg: impl Into<String>) -> Self
Sourcepub fn argument_error(detail: impl Into<String>) -> Self
pub fn argument_error(detail: impl Into<String>) -> Self
An argument-value rejection in Neo4j’s ArgumentError class
(ADR-0489): the class a DDL command’s OPTIONS/indexConfig
validation carries. The detail text is the historical one, so only
the class changes.
Sourcepub fn argument_value_kind(kind: ErrorKind, detail: impl Into<String>) -> Self
pub fn argument_value_kind(kind: ErrorKind, detail: impl Into<String>) -> Self
A run-time argument rejection in the ArgumentError class whose
detail carries kind’s token — live Neo4j reports point()’s in-map
rejections this way, with the token naming the kind of argument
fault (InvalidArgumentValue for a value domain, 22N20/22N21/22N23;
InvalidArgumentType for a wrong type, 22N27 → 22G03; verified
2026-11-06). The token composes from ErrorKind, so the class and
the kind spelling cannot drift apart. One entry point whose name
states the class and whose token is data — the class can no longer
be picked by word order, which is the hazard
Self::invalid_argument_type (TypeError class) shares a spelling
with. Distinct from Self::argument_error by stage: this one is
discovered while producing rows.
Sourcepub fn uniqueness_violation(name: impl Into<String>) -> Self
pub fn uniqueness_violation(name: impl Into<String>) -> Self
A uniqueness violation naming the violated constraint — the typed
counterpart of the pinned ConstraintValidationFailed message text.
Sourcepub fn constraint_creation_failed(detail: impl Into<String>) -> Self
pub fn constraint_creation_failed(detail: impl Into<String>) -> Self
A constraint a statement created failed its data check, carrying the
wrapped rule failure’s bare detail — the typed counterpart of the
pinned ConstraintCreationFailed: <detail> message text.
Sourcepub fn procedure_not_found(name: impl Into<String>) -> Self
pub fn procedure_not_found(name: impl Into<String>) -> Self
A call to an unregistered procedure, naming it — the typed
counterpart of the pinned ProcedureNotFound: <name> message text
(ADR-0138).
Sourcepub fn unknown_function(name: &str) -> Self
pub fn unknown_function(name: &str) -> Self
A call to a function the engine does not register, naming it — the
one spelling of the pinned UnknownFunction: unknown function <name>() text (42N48, a SyntaxError-class error). The planner’s
binding-time check and the executor’s scalar-eval backstop both call
this so the two layers cannot drift apart.
Sourcepub fn invalid_argument_type(detail: impl Into<String>) -> Self
pub fn invalid_argument_type(detail: impl Into<String>) -> Self
An argument of the wrong type, with the detail text after the pinned
InvalidArgumentType: token — the typed counterpart of the legacy
Type("InvalidArgumentType: <detail>") string.
Sourcepub fn invalid_argument_type_expected(expected: &str, actual: &str) -> Self
pub fn invalid_argument_type_expected(expected: &str, actual: &str) -> Self
A wrong-typed argument whose detail is the shared 22N01 sentence
(expected_type_detail) — the one constructor of that family, so
callers stop hand-spelling it.
Sourcepub fn invalid_argument_value(detail: impl Into<String>) -> Self
pub fn invalid_argument_value(detail: impl Into<String>) -> Self
A value outside an argument’s domain, with the detail text after the
pinned InvalidArgumentValue: token — the typed counterpart of the
legacy Type("InvalidArgumentValue: <detail>") string, composing
the token once.
Sourcepub fn invalid_number_of_arguments(detail: impl Into<String>) -> Self
pub fn invalid_number_of_arguments(detail: impl Into<String>) -> Self
A call outside its arity requirement, with the detail text after the
pinned InvalidNumberOfArguments: token — the one composer of that
class, so an ArityContract detail is never token-prefixed twice.
Sourcepub fn requires_boolean(ctx: &str) -> Self
pub fn requires_boolean(ctx: &str) -> Self
A boolean-requiring context that received a non-boolean, with the
detail text <ctx> requires a boolean — the one constructor of the
ADR-0511 boolean family, so the wording cannot drift between the
planner’s and the executor’s requiring sites. ctx is the site’s
own naming of the position ("predicate", an operator’s spelling,
or a dynamic context like "quantifier WHERE").
Sourcepub fn static_requires_boolean(ctx: &str) -> Self
pub fn static_requires_boolean(ctx: &str) -> Self
The compile-time sibling of Self::requires_boolean: the same
<ctx> requires a boolean detail over the Syntax class, because a
statically non-boolean operand or predicate is Neo4j’s compile-time
SyntaxError, while a value whose type is only known per row keeps
the runtime TypeError from Self::requires_boolean. Both read one
detail spelling.
Sourcepub fn into_syntax(self) -> Self
pub fn into_syntax(self) -> Self
Re-class an error into the compile-time Syntax class carrying only
its typed detail — never its rendered Display, whose
<class> error: prefix would be re-embedded and double the class.
The token-carrying variants keep their pinned token
(Error::typed_detail_text); the bare Type/Semantic payloads
keep only their detail. A variant with neither (a capacity refusal, a
cancellation) keeps its own class: its payload is not a string this
helper can re-home.
Sourcepub fn type_error(detail: impl Into<String>) -> Self
pub fn type_error(detail: impl Into<String>) -> Self
A runtime type failure under the legacy TypeError detail name, with
the detail text after the pinned TypeError: token.
Sourcepub fn parameter_missing(detail: impl Into<String>) -> Self
pub fn parameter_missing(detail: impl Into<String>) -> Self
A query parameter that was not supplied, with the detail text after
the pinned ParameterMissing: token — the typed counterpart of the
legacy Semantic("ParameterMissing: <detail>") string.
Sourcepub fn parameters_missing<'a>(names: impl IntoIterator<Item = &'a str>) -> Self
pub fn parameters_missing<'a>(names: impl IntoIterator<Item = &'a str>) -> Self
A statement that references parameters the caller did not supply
(ADR-0308): the Expected parameter(s): <names> detail, the names
joined by , in the order given. The one spelling of the message.
Sourcepub fn database_not_found(name: impl Into<String>) -> Self
pub fn database_not_found(name: impl Into<String>) -> Self
A database or USE target that is not a fixed namespace, naming it
(ADR-0307) — the typed counterpart of the pinned
DatabaseNotFound: Graph not found: <name> text.
Sourcepub fn undefined_variable(name: &str) -> Self
pub fn undefined_variable(name: &str) -> Self
A reference to a variable the evaluated row does not bind (ADR-0335)
— the executor-side counterpart of the front-end’s
UndefinedVariable semantic error, for expressions the plan-time
binding walk cannot see (catalog predicates lowered at run time).
Renders byte-identically to the front-end’s error:
syntax error: UndefinedVariable: variable '<name>' not defined.
Sourcepub fn invalid_aggregation(detail: impl Into<String>) -> Self
pub fn invalid_aggregation(detail: impl Into<String>) -> Self
A 42I24 InvalidAggregation: an aggregate call outside an
aggregation context. Neo4j reports it as a compile-time
SyntaxError carrying the InvalidAggregation kind token, the class
the front end’s typed channel uses; the executor’s scalar-eval
backstop renders the same token through this one constructor.
Sourcepub fn duplicate_variable(name: &str) -> Self
pub fn duplicate_variable(name: &str) -> Self
A binding that redeclares a name its scope already binds — the
planner-side counterpart of the front end’s VariableAlreadyBound.
Renders syntax error: VariableAlreadyBound: variable '<name>' already declared from the same detail helper the typed channel
uses, so the two channels cannot drift.
pub fn ty(msg: impl Into<String>) -> Self
pub fn arithmetic(failure: ArithmeticFailure) -> Self
pub fn execution(error: impl Into<String>) -> Self
Sourcepub fn cancelled() -> Self
pub fn cancelled() -> Self
The one spelling of statement cancellation (see crate::cancel):
Error::Cancelled, whose Display is the documented
"query cancelled" contract string.
pub fn conflict() -> Self
pub fn capacity(used: u64, limit: u64) -> Self
Sourcepub fn capacity_expression(bytes: u64, limit: u64) -> Self
pub fn capacity_expression(bytes: u64, limit: u64) -> Self
The ADR-0463 expression refusal: one allocation of bytes exceeds
limit. The Display is the plain-language line the user sees — what
was built, in MB/GB, and the one action — never the internal
bytes/slots vocabulary.
Sourcepub fn capacity_wal_payload(counted: u64, limit: u64) -> Self
pub fn capacity_wal_payload(counted: u64, limit: u64) -> Self
The ADR-0494 per-record WAL payload cap refusal: the bounded
serializer stopped at counted bytes — a lower bound of the record
the statement tried to commit — against the limit the check
consulted (WAL_PAYLOAD_CAP_BYTES at both refusal sites).
Sourcepub fn capacity_seek_candidates(counted: u64, limit: u64) -> Self
pub fn capacity_seek_candidates(counted: u64, limit: u64) -> Self
The shortest-path endpoint refusal: the bounded candidate scan
stopped at counted matches (a lower bound) against the limit it
consulted.
Sourcepub fn resource_limit(name: &'static str, limit: u64, retryable: bool) -> Self
pub fn resource_limit(name: &'static str, limit: u64, retryable: bool) -> Self
A processing control refused work. The display text names the control and the configured limit.
Sourcepub fn resource_limit_with_receipt(
name: &'static str,
limit: u64,
retryable: bool,
receipt: ExecutionReceipt,
) -> Self
pub fn resource_limit_with_receipt( name: &'static str, limit: u64, retryable: bool, receipt: ExecutionReceipt, ) -> Self
Self::resource_limit plus the token receipt counted so far.
Sourcepub fn receipt(&self) -> Option<&ExecutionReceipt>
pub fn receipt(&self) -> Option<&ExecutionReceipt>
The token receipt attached to a resource-limit error, when the refusal came from token admission.
pub fn storage(msg: impl Into<String>) -> Self
pub fn io(msg: impl Into<String>) -> Self
pub fn internal(msg: impl Into<String>) -> Self
Sourcepub fn typed_detail(&self) -> Option<(&'static str, Cow<'_, str>)>
pub fn typed_detail(&self) -> Option<(&'static str, Cow<'_, str>)>
The pinned class token and detail payload of the seven typed detail
variants (Error::UniquenessViolation,
Error::ProcedureNotFound, Error::InvalidArgumentType,
Error::TypeError, Error::ParameterMissing,
Error::DatabaseNotFound, Error::ArgumentValue), single-sourced
beside the Display attributes that own the same tokens so consumers
classify and re-render the legacy bare text without re-spelling
them. The detail borrows where the variant stores it verbatim and is
owned where Display composes it (the uniqueness violation’s
`<name>` uniqueness, the CE Graph not found: <name>).
Error::ArgumentValue is the one exception to the first element
being a class: its token is the argument-fault kind the variant
carries, so a consumer that wants that variant’s class reads the
engine’s error classification instead.
None for every other class.
Sourcepub fn typed_detail_text(&self) -> Option<String>
pub fn typed_detail_text(&self) -> Option<String>
The legacy bare detail text — <Token>: <detail> — of the typed
detail variants, exactly as the stringly Type/Semantic payloads
spelled it. Built on Error::typed_detail; None for every
other class.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<DynamicAccessError> for Error
impl From<DynamicAccessError> for Error
Source§fn from(error: DynamicAccessError) -> Self
fn from(error: DynamicAccessError) -> Self
Source§impl<T> From<PoisonError<T>> for Error
The one spelling of the poisoned-lock policy (AGENTS.md: one canonical
helper per policy): a panicked lock holder fences the operation with an
internal error instead of silently proceeding on possibly torn state.
Every .lock()? / .read()? on a store mutex or lock resolves through
this impl.
impl<T> From<PoisonError<T>> for Error
The one spelling of the poisoned-lock policy (AGENTS.md: one canonical
helper per policy): a panicked lock holder fences the operation with an
internal error instead of silently proceeding on possibly torn state.
Every .lock()? / .read()? on a store mutex or lock resolves through
this impl.
Source§fn from(err: PoisonError<T>) -> Self
fn from(err: PoisonError<T>) -> Self
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Forget for Error
impl Freeze for Error
impl Move for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.