#[non_exhaustive]pub enum GraphError {
Show 13 variants
Storage {
source: Error,
hint: Option<String>,
},
Serialization {
context: String,
source: String,
hint: Option<String>,
},
Query(QueryError),
NodeNotFound {
id: NodeId,
hint: Option<String>,
},
EdgeNotFound {
src: NodeId,
label: String,
dst: NodeId,
hint: Option<String>,
},
HasEdges {
id: NodeId,
hint: Option<String>,
},
Transaction {
message: String,
hint: Option<String>,
},
IndexAlreadyExists {
label: String,
properties: Vec<String>,
hint: Option<String>,
},
IndexNotFound {
label: String,
properties: Vec<String>,
hint: Option<String>,
},
InvalidIndexDefinition {
reason: String,
hint: Option<String>,
},
InvalidName {
name: String,
hint: Option<String>,
},
SizeLimit {
what: String,
limit: usize,
actual: usize,
hint: Option<String>,
},
SchemaMismatch {
found: u64,
supported: u64,
hint: Option<String>,
},
}Expand description
All errors returned by graphdblite.
Every variant (except Query, which delegates to QueryError’s own hint)
carries a hint: Option<String> for actionable suggestions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Storage
Serialization
Query(QueryError)
Cypher query processing error (parse/semantic/runtime).
NodeNotFound
EdgeNotFound
HasEdges
Transaction
Internal transaction / concurrency error.
IndexAlreadyExists
IndexNotFound
InvalidIndexDefinition
InvalidName
SizeLimit
SchemaMismatch
Implementations§
Source§impl GraphError
impl GraphError
Sourcepub fn syntax(message: impl Into<String>) -> Self
pub fn syntax(message: impl Into<String>) -> Self
Convenience constructor for syntax errors at the parse phase.
Sourcepub fn semantic(message: impl Into<String>) -> Self
pub fn semantic(message: impl Into<String>) -> Self
Convenience constructor for semantic errors at the analysis phase.
Sourcepub fn constraint(message: impl Into<String>) -> Self
pub fn constraint(message: impl Into<String>) -> Self
Convenience constructor for runtime constraint violations.
Sourcepub fn type_error(phase: QueryPhase, message: impl Into<String>) -> Self
pub fn type_error(phase: QueryPhase, message: impl Into<String>) -> Self
Convenience constructor for type errors.
Sourcepub fn argument(phase: QueryPhase, message: impl Into<String>) -> Self
pub fn argument(phase: QueryPhase, message: impl Into<String>) -> Self
Convenience constructor for argument errors (e.g. missing parameters).
Sourcepub fn undefined_variable(name: impl Display) -> Self
pub fn undefined_variable(name: impl Display) -> Self
Reference to a name not bound in the current scope.
Sourcepub fn procedure_not_found(name: impl Display) -> Self
pub fn procedure_not_found(name: impl Display) -> Self
Procedure name not registered in the procedure registry.
Sourcepub fn invalid_argument_type(
phase: QueryPhase,
function: impl Display,
got: impl Display,
) -> Self
pub fn invalid_argument_type( phase: QueryPhase, function: impl Display, got: impl Display, ) -> Self
Function called with a value of an unsupported type.
Sourcepub fn invalid_argument_value(
phase: QueryPhase,
function: impl Display,
message: impl Display,
) -> Self
pub fn invalid_argument_value( phase: QueryPhase, function: impl Display, message: impl Display, ) -> Self
Value passed to a function is out of the supported range.
Sourcepub fn number_out_of_range(
phase: QueryPhase,
message: impl Into<String>,
) -> Self
pub fn number_out_of_range( phase: QueryPhase, message: impl Into<String>, ) -> Self
Numeric overflow / value outside the representable range.
Sourcepub fn query(
phase: QueryPhase,
code: ErrorCode,
message: impl Into<String>,
) -> Self
pub fn query( phase: QueryPhase, code: ErrorCode, message: impl Into<String>, ) -> Self
Lower-level builder for arbitrary query errors with a known code.
Sourcepub fn with_hint(self, hint: impl Into<String>) -> Self
pub fn with_hint(self, hint: impl Into<String>) -> Self
Attach a hint to a query error in place. No-op for non-Query variants
that already have a hint field — call the variant constructor with
the hint instead.
Sourcepub fn with_code(self, code: ErrorCode) -> Self
pub fn with_code(self, code: ErrorCode) -> Self
Attach a structured code to a query error. No-op for non-Query variants.
Sourcepub fn with_span(self, span: Span) -> Self
pub fn with_span(self, span: Span) -> Self
Attach a source-text span to a query error. No-op for non-Query variants or for synthetic spans (planner-rewritten nodes).
Sourcepub fn serialization(context: impl Into<String>, source: impl Display) -> Self
pub fn serialization(context: impl Into<String>, source: impl Display) -> Self
Wrap an internal serialization failure with a context tag.
Sourcepub fn transaction(message: impl Into<String>) -> Self
pub fn transaction(message: impl Into<String>) -> Self
Wrap an internal transaction failure.
Trait Implementations§
Source§impl Debug for GraphError
impl Debug for GraphError
Source§impl Display for GraphError
impl Display for GraphError
Source§impl Error for GraphError
impl Error for GraphError
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()