Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 21 variants Syntax(String), Semantic(String), ArgumentError(String), ArgumentValue { kind: ErrorKind, detail: String, }, UniquenessViolation { name: 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).

Fields

§detail: String
§

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.

Fields

§name: String
§

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.

Fields

§name: String
§

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.

Fields

§name: String
§

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.

Fields

§used: u64
§limit: u64
§

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.

Fields

§name: &'static str
§limit: u64
§retryable: bool
§

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

Source

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.

Source

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.

Source

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.

Source

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).

Source

pub fn syntax(msg: impl Into<String>) -> Self

Source

pub fn semantic(msg: impl Into<String>) -> Self

Source

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.

Source

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.

Source

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.

Source

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).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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").

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn ty(msg: impl Into<String>) -> Self

Source

pub fn arithmetic(failure: ArithmeticFailure) -> Self

Source

pub fn execution(error: impl Into<String>) -> Self

Source

pub fn cancelled() -> Self

The one spelling of statement cancellation (see crate::cancel): Error::Cancelled, whose Display is the documented "query cancelled" contract string.

Source

pub fn conflict() -> Self

Source

pub fn capacity(used: u64, limit: u64) -> Self

Source

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.

Source

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).

Source

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.

Source

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.

Source

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.

Source

pub fn receipt(&self) -> Option<&ExecutionReceipt>

The token receipt attached to a resource-limit error, when the refusal came from token admission.

Source

pub fn storage(msg: impl Into<String>) -> Self

Source

pub fn io(msg: impl Into<String>) -> Self

Source

pub fn internal(msg: impl Into<String>) -> Self

Source

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.

Source

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§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Error

Source§

impl Error for Error

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<DynamicAccessError> for Error

Source§

fn from(error: DynamicAccessError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(e: Error) -> Self

Converts to this type from the input type.
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.

Source§

fn from(err: PoisonError<T>) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Error

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.