pub enum ErrorCode {
Show 24 variants
QuerySyntax,
QuerySemantic,
QueryTimeout,
QueryUnsupported,
QueryOptimization,
QueryExecution,
TransactionConflict,
TransactionTimeout,
TransactionReadOnly,
TransactionInvalidState,
TransactionSerialization,
TransactionDeadlock,
StorageFull,
StorageCorrupted,
StorageRecoveryFailed,
InvalidInput,
NodeNotFound,
EdgeNotFound,
PropertyNotFound,
LabelNotFound,
TypeMismatch,
Internal,
SerializationError,
IoError,
}Expand description
Machine-readable error code for programmatic error handling.
Error codes follow the pattern GRAFEO-{category}{number}:
- Q: Query errors (parse, semantic, timeout)
- T: Transaction errors (conflict, timeout, state)
- S: Storage errors (full, corruption)
- V: Validation errors (not found, type mismatch, invalid input)
- X: Internal errors (should not happen)
Clients can match on these codes without parsing error messages.
§Examples
use grafeo_common::utils::error::{Error, ErrorCode};
let err = Error::Internal("something broke".into());
assert_eq!(err.error_code().as_str(), "GRAFEO-X001");
assert!(!err.error_code().is_retryable());Variants§
QuerySyntax
Query failed to parse.
QuerySemantic
Query parsed but is invalid (unknown label, type mismatch, etc.).
QueryTimeout
Query exceeded timeout.
QueryUnsupported
Feature not supported for this query language.
QueryOptimization
Query optimization failed.
QueryExecution
Query execution failed.
TransactionConflict
Write-write conflict (retry possible).
TransactionTimeout
Transaction exceeded TTL.
TransactionReadOnly
Transaction is read-only but attempted a write.
TransactionInvalidState
Invalid transaction state.
TransactionSerialization
Serialization failure (SSI violation).
TransactionDeadlock
Deadlock detected.
StorageFull
Memory or disk limit reached.
StorageCorrupted
WAL or data corruption detected.
StorageRecoveryFailed
Recovery from WAL failed.
InvalidInput
Request validation failed.
NodeNotFound
Node not found.
EdgeNotFound
Edge not found.
PropertyNotFound
Property key not found.
LabelNotFound
Label not found.
TypeMismatch
Type mismatch.
Internal
Unexpected internal error.
SerializationError
Serialization/deserialization error.
IoError
I/O error.
Implementations§
Trait Implementations§
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.