Skip to main content

NoxuError

Enum NoxuError 

Source
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:

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: EnvironmentFailureReason

The root cause of the failure.

§msg: String

Human-readable detail message.

§

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.

Fields

§used: u64

Bytes currently used by the environment.

§limit: u64

Configured limit in bytes.

§

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

§timeout_ms: u64

How long the locker waited before giving up.

§detail: String

Full diagnostic message from the lock manager (owner, requester, LSN). Empty string when not available.

§

LockNotAvailable

A lock was requested with no-wait semantics and was not immediately available.

Retryable.

§

TransactionTimeout

A transaction-level timeout expired.

Retryable.

Fields

§timeout_ms: u64

Transaction-level timeout in milliseconds.

§txn_id: i64

ID of the timed-out transaction.

§

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

§required: u32

Acknowledgement quorum required.

§available: u32

Number of replicas that responded.

§

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

Source

pub fn is_retryable(&self) -> bool

Returns true if the failed operation may be retried after aborting the current transaction.

Mirrors OperationFailureException.isRetryable().

Source

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

Source

pub fn reason(&self) -> Option<&EnvironmentFailureReason>

Returns the EnvironmentFailureReason if this is an EnvironmentFailure variant, None otherwise.

Mirrors EnvironmentFailureException.getReason().

Source

pub fn is_corrupted(&self) -> bool

Returns true if the environment log is persistently corrupted.

Mirrors EnvironmentFailureException.isCorrupted().

Source

pub fn is_lock_conflict(&self) -> bool

Returns true if this is a lock-conflict error.

Source

pub fn is_lock_timeout(&self) -> bool

Returns true if this is a lock or transaction timeout.

Source

pub fn is_database_not_found(&self) -> bool

Returns true if the named database was not found.

Source

pub fn is_operation_failure(&self) -> bool

Returns true for any OperationFailureException-equivalent.

Source

pub fn environment(msg: impl Into<String>) -> NoxuError

Creates an EnvironmentFailure with UnexpectedState reason. Use when the specific reason is unknown.

Source

pub fn environment_with_reason( reason: EnvironmentFailureReason, msg: impl Into<String>, ) -> NoxuError

Creates an EnvironmentFailure with an explicit reason.

Source

pub fn database(msg: impl Into<String>) -> NoxuError

Creates an OperationNotAllowed error.

Source

pub fn invalid_argument(msg: impl Into<String>) -> NoxuError

Creates an IllegalArgument error.

Source

pub fn lock_conflict(msg: impl Into<String>) -> NoxuError

Creates a LockConflict error.

Source

pub fn lock_timeout(timeout_ms: u64) -> NoxuError

Creates a LockTimeout error.

Source

pub fn database_not_found(name: impl Into<String>) -> NoxuError

Creates a DatabaseNotFound error.

Source

pub fn disk_limit_exceeded(used: u64, limit: u64) -> NoxuError

Creates a DiskLimitExceeded error.

Trait Implementations§

Source§

impl Debug for NoxuError

Source§

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

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

impl Display for NoxuError

Source§

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

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

impl Error for NoxuError

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<DbiError> for NoxuError

Source§

fn from(e: DbiError) -> NoxuError

Converts to this type from the input type.
Source§

impl From<Error> for NoxuError

Source§

fn from(source: Error) -> NoxuError

Converts to this type from the input type.
Source§

impl From<NoxuError> for CollectionError

Source§

fn from(source: NoxuError) -> CollectionError

Converts to this type from the input type.
Source§

impl From<NoxuError> for PersistError

Source§

fn from(source: NoxuError) -> PersistError

Converts to this type from the input type.
Source§

impl From<NoxuError> for XaError

Source§

fn from(source: NoxuError) -> XaError

Converts to this type from the input type.
Source§

impl From<TxnError> for NoxuError

Source§

fn from(e: TxnError) -> NoxuError

Converts to this type from the input type.

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more