pub enum GraphdError {
Forbidden(String),
SyntaxError(String),
TypeError(String),
DatabaseUnavailable(String),
DatabaseError(String),
}Expand description
Typed errors for the graphd-engine API, aligned with Neo4j’s error classification.
Each variant maps directly to a Neo.{Classification}.{Category}.{Title} code.
Drivers use these codes for retry logic, error categorization, and user display.
Neo4j-compatible error classification.
Variants follow Neo4j’s three-tier hierarchy:
- ClientError (4xx): Client sent a bad request — not retryable.
- DatabaseError (5xx): Server failed — not retryable by default.
- TransientError: Temporary condition — retryable.
Variants§
Forbidden(String)
Neo.ClientError.Security.Forbidden — operation blocked by policy.
Sandbox violations, disallowed CALL options, blocked statements.
SyntaxError(String)
Neo.ClientError.Statement.SyntaxError — query parse or execution error.
Covers both Cypher syntax errors and runtime query failures from the engine.
TypeError(String)
Neo.ClientError.Statement.TypeError — invalid parameter types.
Unsupported number format, objects passed as params, non-object params value.
Neo.TransientError.General.DatabaseUnavailable — engine temporarily unavailable.
Semaphore/mutex closed, connection pool exhausted, shutdown in progress.
DatabaseError(String)
Neo.DatabaseError.General.UnknownError — internal server error.
Task panics, connection failures, database open failures, unexpected state.
Implementations§
Source§impl GraphdError
impl GraphdError
Sourcepub fn neo4j_code(&self) -> &'static str
pub fn neo4j_code(&self) -> &'static str
Full Neo4j error code string (e.g. Neo.ClientError.Security.Forbidden).
Sourcepub fn is_client_error(&self) -> bool
pub fn is_client_error(&self) -> bool
Whether this is a client error (bad request, not retryable).
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether the client should retry this request.
Sourcepub fn http_status(&self) -> u16
pub fn http_status(&self) -> u16
HTTP status code for this error.
Trait Implementations§
Source§impl Clone for GraphdError
impl Clone for GraphdError
Source§impl Debug for GraphdError
impl Debug for GraphdError
Source§impl Display for GraphdError
impl Display for GraphdError
Source§impl Error for GraphdError
impl Error for GraphdError
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()