pub enum NoxuError {
Show 43 variants
EnvironmentFailure {
reason: EnvironmentFailureReason,
msg: String,
},
EnvironmentWedged(String),
EnvironmentNotFound(String),
EnvironmentLocked(String),
LogWriteFailure(String),
DiskLimitExceeded {
used: u64,
limit: u64,
},
ThreadInterrupted,
DatabaseNotFound(String),
DatabaseAlreadyExists(String),
DatabaseClosed,
EnvironmentClosed,
CursorClosed,
LockConflict(String),
DeadlockDetected,
LockTimeout {
timeout_ms: u64,
detail: String,
},
LockNotAvailable,
TransactionTimeout {
timeout_ms: u64,
txn_id: i64,
},
LockPreempted,
TransactionAborted(String),
KeyExists,
UniqueConstraintViolation(String),
DeleteConstraintViolation(String),
ForeignConstraintViolation(String),
DuplicateDataException,
SecondaryIntegrityException(String),
SequenceExists(String),
SequenceNotFound(String),
SequenceOverflow,
SequenceIntegrity(String),
NotFound,
ReadOnly,
ReplicaWrite,
InsufficientReplicas {
required: u32,
available: u32,
},
RollbackRequired(String),
LogChecksumMismatch(String),
LogFileNotFound(String),
IoError(Error),
VersionMismatch(String),
OperationNotAllowed(String),
IllegalArgument(String),
Timeout,
InvalidOperation(String),
Unsupported(String),
}Expand description
Errors that can occur when using Noxu DB.
Implements exception hierarchy:
NoxuError::EnvironmentFailure— potentially fatal; checkNoxuError::is_fatal_to_environment. Carries anEnvironmentFailureReasonfor discriminating the cause.- Operation-failure variants are retryable after abort
(
NoxuError::is_retryable). - HA / replication variants (
NoxuError::InsufficientReplicas,NoxuError::ReplicaWrite,NoxuError::RollbackRequired).
Variants§
EnvironmentFailure
A failure has occurred that may require the environment to be closed
and re-opened. Check NoxuError::is_fatal_to_environment /
NoxuError::reason to determine whether restart is required.
Fields
reason: EnvironmentFailureReasonThe root cause of the failure.
EnvironmentWedged(String)
The environment is permanently wedged and cannot recover even after close/re-open. Operator intervention or backup restore is required.
EnvironmentNotFound(String)
The environment home directory was not found and allow_create = false.
EnvironmentLocked(String)
The environment is already open by another process.
LogWriteFailure(String)
An I/O error occurred while writing to the log. The disk may be full.
DiskLimitExceeded
The disk limit (MAX_DISK / FREE_DISK) was exceeded.
ThreadInterrupted
The calling thread was interrupted while performing a
DatabaseNotFound(String)
The requested database was not found in the environment.
DatabaseAlreadyExists(String)
An attempt was made to create a database that already exists.
DatabaseClosed
An operation was attempted on a closed database.
EnvironmentClosed
An operation was attempted on a closed environment.
CursorClosed
An operation was attempted on a closed cursor.
LockConflict(String)
A lock conflict occurred (locker blocked and could not acquire).
Retryable.
DeadlockDetected
A deadlock was detected between two or more transactions.
Retryable.
LockTimeout
A lock-wait timeout expired.
Retryable.
Fields
LockNotAvailable
A lock was requested with no-wait semantics and was not immediately
available.
Retryable.
TransactionTimeout
A transaction-level timeout expired.
Retryable.
Fields
LockPreempted
A lock was preempted by a higher-priority locker (HA).
Retryable.
TransactionAborted(String)
The transaction was aborted.
KeyExists
The key already exists (put_no_overwrite / cursor put_no_dup_data).
UniqueConstraintViolation(String)
A unique-index constraint was violated.
DeleteConstraintViolation(String)
A delete was attempted on a primary record referenced by a secondary index.
ForeignConstraintViolation(String)
A foreign-key constraint was violated.
DuplicateDataException
Duplicate data was supplied to a putNoDupData operation in a
duplicate-sorted database.
SecondaryIntegrityException(String)
A secondary database integrity constraint was violated.
SequenceExists(String)
A sequence with the given name already exists.
SequenceNotFound(String)
A sequence with the given name was not found.
SequenceOverflow
A sequence has overflowed or underflowed its range.
SequenceIntegrity(String)
A sequence integrity violation was detected.
NotFound
A key or data item was not found.
ReadOnly
The database or environment is in read-only mode.
ReplicaWrite
A write was attempted on a replica node.
InsufficientReplicas
Insufficient replicas acknowledged the commit.
Fields
RollbackRequired(String)
The transaction must be rolled back due to a replication state change.
LogChecksumMismatch(String)
A log checksum mismatch was detected (potential corruption).
Fatal: the environment will be invalidated.
LogFileNotFound(String)
A log file was not found.
IoError(Error)
An I/O error occurred.
VersionMismatch(String)
A version mismatch occurred (e.g. on-disk format vs. code version).
OperationNotAllowed(String)
The operation is not allowed in the current state.
IllegalArgument(String)
An illegal argument was provided to a method.
Mirrors IllegalArgumentException (DB flavour).
Timeout
The operation timed out (non-lock, non-txn — e.g. network or sync).
InvalidOperation(String)
An invalid operation was requested.
Unsupported(String)
The requested operation is recognised by the API but not yet
implemented. The argument names the operation (for example
"Get::SearchLte").
Returned by API arms that previously fell through to a silent
OperationStatus::NotFound; users now see a loud, typed error
instead of a misleading miss. Tracked in
docs/src/internal/api-audit-2026-05-cursor.md Finding 3.
Implementations§
Source§impl NoxuError
impl NoxuError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns true if the failed operation may be retried after aborting
the current transaction.
Mirrors OperationFailureException.isRetryable().
Sourcepub fn is_fatal_to_environment(&self) -> bool
pub fn is_fatal_to_environment(&self) -> bool
Returns true if this error is fatal to the environment.
After a fatal error the environment must be closed and re-opened.
Subsequent operations on an invalidated environment will return
EnvironmentClosed.
Mirrors EnvironmentFailureException detection + isValid().
Sourcepub fn reason(&self) -> Option<&EnvironmentFailureReason>
pub fn reason(&self) -> Option<&EnvironmentFailureReason>
Returns the EnvironmentFailureReason if this is an
EnvironmentFailure variant, None otherwise.
Mirrors EnvironmentFailureException.getReason().
Sourcepub fn is_corrupted(&self) -> bool
pub fn is_corrupted(&self) -> bool
Returns true if the environment log is persistently corrupted.
Mirrors EnvironmentFailureException.isCorrupted().
Sourcepub fn is_lock_conflict(&self) -> bool
pub fn is_lock_conflict(&self) -> bool
Returns true if this is a lock-conflict error.
Sourcepub fn is_lock_timeout(&self) -> bool
pub fn is_lock_timeout(&self) -> bool
Returns true if this is a lock or transaction timeout.
Sourcepub fn is_database_not_found(&self) -> bool
pub fn is_database_not_found(&self) -> bool
Returns true if the named database was not found.
Sourcepub fn is_operation_failure(&self) -> bool
pub fn is_operation_failure(&self) -> bool
Returns true for any OperationFailureException-equivalent.
Sourcepub fn environment(msg: impl Into<String>) -> Self
pub fn environment(msg: impl Into<String>) -> Self
Creates an EnvironmentFailure with UnexpectedState reason.
Use when the specific reason is unknown.
Sourcepub fn environment_with_reason(
reason: EnvironmentFailureReason,
msg: impl Into<String>,
) -> Self
pub fn environment_with_reason( reason: EnvironmentFailureReason, msg: impl Into<String>, ) -> Self
Creates an EnvironmentFailure with an explicit reason.
Sourcepub fn invalid_argument(msg: impl Into<String>) -> Self
pub fn invalid_argument(msg: impl Into<String>) -> Self
Creates an IllegalArgument error.
Sourcepub fn lock_conflict(msg: impl Into<String>) -> Self
pub fn lock_conflict(msg: impl Into<String>) -> Self
Creates a LockConflict error.
Sourcepub fn lock_timeout(timeout_ms: u64) -> Self
pub fn lock_timeout(timeout_ms: u64) -> Self
Creates a LockTimeout error.
Sourcepub fn database_not_found(name: impl Into<String>) -> Self
pub fn database_not_found(name: impl Into<String>) -> Self
Creates a DatabaseNotFound error.
Sourcepub fn disk_limit_exceeded(used: u64, limit: u64) -> Self
pub fn disk_limit_exceeded(used: u64, limit: u64) -> Self
Creates a DiskLimitExceeded error.
Trait Implementations§
Source§impl Error for NoxuError
impl Error for NoxuError
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()