pub enum Error {
Show 38 variants
InvalidInput {
source: Box<dyn Error + Send + Sync + 'static>,
location: Location,
backtrace: MaybeBacktrace,
},
DatasetAlreadyExists {
uri: String,
location: Location,
backtrace: MaybeBacktrace,
},
SchemaMismatch {
difference: String,
location: Location,
backtrace: MaybeBacktrace,
},
DatasetNotFound {
path: String,
source: Box<dyn Error + Send + Sync + 'static>,
location: Location,
backtrace: MaybeBacktrace,
},
CorruptFile {
path: Path,
source: Box<dyn Error + Send + Sync + 'static>,
location: Location,
backtrace: MaybeBacktrace,
},
NotSupported {
source: Box<dyn Error + Send + Sync + 'static>,
location: Location,
backtrace: MaybeBacktrace,
},
CommitConflict {
version: u64,
source: Box<dyn Error + Send + Sync + 'static>,
location: Location,
backtrace: MaybeBacktrace,
},
IncompatibleTransaction {
source: Box<dyn Error + Send + Sync + 'static>,
location: Location,
backtrace: MaybeBacktrace,
},
RetryableCommitConflict {
version: u64,
source: Box<dyn Error + Send + Sync + 'static>,
location: Location,
backtrace: MaybeBacktrace,
},
TooMuchWriteContention {
message: String,
location: Location,
backtrace: MaybeBacktrace,
},
Timeout {
message: String,
location: Location,
},
Internal {
message: String,
location: Location,
backtrace: MaybeBacktrace,
},
PrerequisiteFailed {
message: String,
location: Location,
backtrace: MaybeBacktrace,
},
Unprocessable {
message: String,
location: Location,
backtrace: MaybeBacktrace,
},
Arrow {
message: String,
location: Location,
backtrace: MaybeBacktrace,
},
Schema {
message: String,
location: Location,
backtrace: MaybeBacktrace,
},
NotFound {
uri: String,
location: Location,
backtrace: MaybeBacktrace,
},
IO {
source: Box<dyn Error + Send + Sync + 'static>,
location: Location,
backtrace: MaybeBacktrace,
},
Index {
message: String,
location: Location,
backtrace: MaybeBacktrace,
},
IndexNotFound {
identity: String,
location: Location,
backtrace: MaybeBacktrace,
},
InvalidTableLocation {
message: String,
},
Stop,
Wrapped {
error: Box<dyn Error + Send + Sync + 'static>,
location: Location,
backtrace: MaybeBacktrace,
},
Cloned {
message: String,
location: Location,
backtrace: MaybeBacktrace,
},
Execution {
message: String,
location: Location,
backtrace: MaybeBacktrace,
},
InvalidRef {
message: String,
},
RefConflict {
message: String,
},
RefNotFound {
message: String,
},
Cleanup {
message: String,
},
VersionNotFound {
message: String,
},
VersionConflict {
message: String,
major_version: u16,
minor_version: u16,
location: Location,
backtrace: MaybeBacktrace,
},
Namespace {
source: Box<dyn Error + Send + Sync + 'static>,
location: Location,
backtrace: MaybeBacktrace,
},
External {
source: Box<dyn Error + Send + Sync + 'static>,
},
FieldNotFound {
source: FieldNotFoundError,
},
DiskCapExceeded {
cap_bytes: u64,
used_bytes: u64,
location: Location,
},
Fenced {
reason: FenceReason,
message: String,
location: Location,
},
Backpressure {
message: String,
location: Location,
},
Shared {
source: Arc<Self>,
},
}Variants§
InvalidInput
DatasetAlreadyExists
SchemaMismatch
DatasetNotFound
Fields
backtrace: MaybeBacktraceCorruptFile
Fields
backtrace: MaybeBacktraceNotSupported
CommitConflict
Fields
backtrace: MaybeBacktraceIncompatibleTransaction
RetryableCommitConflict
Fields
backtrace: MaybeBacktraceTooMuchWriteContention
Timeout
Internal
PrerequisiteFailed
Unprocessable
Arrow
Schema
NotFound
IO
Index
IndexNotFound
InvalidTableLocation
Stop
Stream early stop
Wrapped
Cloned
Execution
InvalidRef
RefConflict
RefNotFound
Cleanup
VersionNotFound
VersionConflict
Fields
backtrace: MaybeBacktraceNamespace
External
External error passed through from user code.
This variant preserves errors that users pass into Lance APIs (e.g., via streams
with custom error types). The original error can be recovered using Error::into_external
or inspected using Error::external_source.
FieldNotFound
A requested field was not found in a schema.
Fields
source: FieldNotFoundErrorDiskCapExceeded
Fenced
A writer has been fenced and must stop (see FenceReason). The message
keeps the Writer fenced prefix for legacy string consumers; new code
should match on Error::fence_reason.
Backpressure
A write was refused to keep the writer inside its memory budget.
Unlike every other write error this one is expected under load and
carries no data loss: the write was never accepted, so a caller that
retries once the flush pipeline drains loses nothing. Callers should
surface it as a retryable “busy” signal (HTTP 503), not a failure.
Match via Error::is_backpressure rather than on the message.
An error shared behind an Arc so it can be cloned cheaply without
deep-copying its source (see CloneableError). Accessors that read a
variant or typed source rather than the message — Error::external_source,
Error::fence_reason, Error::is_backpressure, Error::is_not_found,
Error::is_commit_status_unknown, Error::backtrace — see through this
wrapper, so a shared error answers them exactly as the error it wraps.
Implementations§
Source§impl Error
impl Error
Sourcepub fn backtrace(&self) -> Option<&Backtrace>
pub fn backtrace(&self) -> Option<&Backtrace>
Returns the captured Rust backtrace, if available.
Always returns None when the backtrace feature is not enabled.
pub fn corrupt_file(path: Path, message: impl Into<String>) -> Self
Sourcepub fn corrupt_file_named(name: &str, message: impl Into<String>) -> Self
pub fn corrupt_file_named(name: &str, message: impl Into<String>) -> Self
Reports a corrupt file when the caller only has a logical/section name rather than the real file path (for example, a decoder that validates an in-memory buffer and does not know where it came from).
name is carried in the path field of the resulting Error::CorruptFile
variant and is NOT a filesystem path; callers that have the real path should
use Self::corrupt_file instead.
pub fn invalid_input(message: impl Into<String>) -> Self
pub fn invalid_input_source( source: Box<dyn Error + Send + Sync + 'static>, ) -> Self
pub fn io(message: impl Into<String>) -> Self
Sourcepub fn fenced_by_peer(message: impl Into<String>) -> Self
pub fn fenced_by_peer(message: impl Into<String>) -> Self
A successor writer claimed a higher epoch; this writer lost ownership.
Sourcepub fn writer_poisoned(message: impl Into<String>) -> Self
pub fn writer_poisoned(message: impl Into<String>) -> Self
Our WAL persistence failed; in-memory state may have diverged from the durable WAL, so the writer must be reopened to replay.
Sourcepub fn find_root(&self) -> &Self
pub fn find_root(&self) -> &Self
Peel every Error::Shared wrapper and return the underlying error.
Accessors route through this, so a shared error answers the same as the
error it wraps. Callers that need to match a concrete variant without an
accessor (such as Error::Timeout) should match on find_root(), so
the match still holds after the error has been shared through a
CloneableError.
Sourcepub fn fence_reason(&self) -> Option<FenceReason>
pub fn fence_reason(&self) -> Option<FenceReason>
The FenceReason if this is Error::Fenced, else None. Prefer this
over matching the error message to decide how to react to a fence.
Sourcepub fn backpressure(message: impl Into<String>) -> Self
pub fn backpressure(message: impl Into<String>) -> Self
A write was refused because the writer is at its memory ceiling; the
data was never accepted. See Error::Backpressure.
Sourcepub fn is_backpressure(&self) -> bool
pub fn is_backpressure(&self) -> bool
Whether this is Error::Backpressure — i.e. a retryable “writer is
full” signal rather than a real failure. Prefer this over matching the
error message.
pub fn io_source(source: Box<dyn Error + Send + Sync + 'static>) -> Self
pub fn dataset_already_exists(uri: impl Into<String>) -> Self
pub fn dataset_not_found( path: impl Into<String>, source: Box<dyn Error + Send + Sync + 'static>, ) -> Self
pub fn version_conflict( message: impl Into<String>, major_version: u16, minor_version: u16, ) -> Self
pub fn not_found(uri: impl Into<String>) -> Self
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Return whether this error or one of its typed sources is a missing object.
pub fn wrapped(error: Box<dyn Error + Send + Sync + 'static>) -> Self
pub fn schema(message: impl Into<String>) -> Self
pub fn not_supported(message: impl Into<String>) -> Self
pub fn not_supported_source( source: Box<dyn Error + Send + Sync + 'static>, ) -> Self
pub fn internal(message: impl Into<String>) -> Self
pub fn timeout(message: impl Into<String>) -> Self
pub fn namespace(message: impl Into<String>) -> Self
pub fn namespace_source(source: Box<dyn Error + Send + Sync + 'static>) -> Self
pub fn arrow(message: impl Into<String>) -> Self
pub fn execution(message: impl Into<String>) -> Self
pub fn cloned(message: impl Into<String>) -> Self
pub fn schema_mismatch(difference: impl Into<String>) -> Self
pub fn unprocessable(message: impl Into<String>) -> Self
pub fn too_much_write_contention(message: impl Into<String>) -> Self
pub fn prerequisite_failed(message: impl Into<String>) -> Self
pub fn index(message: impl Into<String>) -> Self
pub fn index_not_found(identity: impl Into<String>) -> Self
pub fn commit_conflict_source( version: u64, source: Box<dyn Error + Send + Sync + 'static>, ) -> Self
pub fn retryable_commit_conflict_source( version: u64, source: Box<dyn Error + Send + Sync + 'static>, ) -> Self
pub fn commit_status_unknown_source( version: u64, source: Box<dyn Error + Send + Sync + 'static>, ) -> Self
Sourcepub fn is_commit_status_unknown(&self) -> bool
pub fn is_commit_status_unknown(&self) -> bool
Return whether this error represents a commit whose final outcome could not be determined safely.
pub fn incompatible_transaction_source( source: Box<dyn Error + Send + Sync + 'static>, ) -> Self
pub fn disk_cap_exceeded(cap_bytes: u64, used_bytes: u64) -> Self
Sourcepub fn external(source: Box<dyn Error + Send + Sync + 'static>) -> Self
pub fn external(source: Box<dyn Error + Send + Sync + 'static>) -> Self
Create an External error from a boxed error source.
Sourcepub fn field_not_found(
field_name: impl Into<String>,
candidates: Vec<String>,
) -> Self
pub fn field_not_found( field_name: impl Into<String>, candidates: Vec<String>, ) -> Self
Create a FieldNotFound error with the given field name and available candidates.
Sourcepub fn external_source(&self) -> Option<&Box<dyn Error + Send + Sync + 'static>>
pub fn external_source(&self) -> Option<&Box<dyn Error + Send + Sync + 'static>>
Returns a reference to the external error source if this is an External
variant, seeing through any Shared wrapper.
This allows downcasting to recover the original error type.
Sourcepub fn into_external(
self,
) -> Result<Box<dyn Error + Send + Sync + 'static>, Self>
pub fn into_external( self, ) -> Result<Box<dyn Error + Send + Sync + 'static>, Self>
Consumes the error and returns the external source if this is an External
variant, seeing through a sole-owner Shared wrapper.
Otherwise returns Err with an equivalent error for chained handling: a
sole-owner Shared is unwrapped to its inner error, a still-shared one
stays wrapped, and any other error is returned as-is.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl ErrorCompat for Error
impl ErrorCompat for Error
Source§fn iter_chain(&self) -> ChainCompat<'_, '_> ⓘwhere
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_> ⓘwhere
Self: AsErrorSource,
Error::source. Read more