#[non_exhaustive]pub enum Error {
Show 51 variants
MetadataProjection(MetadataProjectionLoadError),
MetadataView(MetadataViewError),
VisiblePath(VisiblePathError),
DurableContent(DurableContentValidationError),
WriterEpoch(WriterEpochAcquireError),
CommitValidation(CommitValidationError),
WalBuild(WalBuildError),
HeadPublish(CommitHeadPublishError),
WalWrite {
object_key: String,
message: String,
class: StoreFailureClass,
},
InvalidPath(String),
InvalidNamespaceId(NamespaceIdValidationError),
InvalidCommitId(CommitIdValidationError),
InvalidCommitRequest(String),
InvalidUploadId(GeneratedIdValidationError),
PathNotFound(String),
RevisionNotFound {
inode_id: InodeId,
revision_no: RevisionNo,
},
ContentTooLarge {
size_bytes: u64,
max_bytes: u64,
},
BatchTooLarge {
requested: usize,
max: usize,
},
ResumeOffsetOutOfRange {
start_offset: u64,
size_bytes: u64,
},
ResumePrefixIncomplete {
start_offset: u64,
folded: u64,
},
ExpectedFile {
path: String,
kind: InodeKind,
},
ExpectedDirectory {
path: String,
kind: InodeKind,
},
DirectoryNotEmpty(String),
RootMutationForbidden,
DestinationExists {
path: String,
existing_display_name: Option<String>,
},
CommitIdReuseConflict {
commit_id: String,
committed_seq: Option<ChangeSeq>,
committed_fingerprint: Option<String>,
},
ContentPreparation(ContentPreparationError),
CommitQueueFull,
ShuttingDown,
CheckpointUnavailable(String),
InvalidCheckpointRequest(String),
MetadataPublicationBudgetExceeded {
elapsed_ms: u64,
budget_ms: u64,
},
InvalidGcConfig(String),
InvalidQuery(String),
QueryUnindexable(String),
IndexLagging {
behind_commits: u64,
},
UploadNotFound {
upload_id: UploadId,
},
UploadAlreadyCompleted {
upload_id: UploadId,
},
UploadContentConflict {
upload_id: UploadId,
},
InvalidUploadContent(String),
InvalidCursor(String),
RebootstrapRequired {
after_seq: ChangeSeq,
retention_floor_seq: ChangeSeq,
},
NonDirectoryPathComponent(String),
NamespaceCorrupt(String),
WriterFenced(WriterFence),
Store {
object_key: String,
message: String,
class: StoreFailureClass,
},
Internal(String),
NamespaceExists {
namespace_id: NamespaceId,
},
NamespaceDeleted {
namespace_id: NamespaceId,
},
StaleHeadPrecondition {
expected: ChangeSeq,
actual: ChangeSeq,
},
FailedOperation {
operation_index: u32,
source: Box<CoreError>,
},
}Expand description
Public error type returned by loonfs-core.
Use Error::kind for broad caller action and Error::code for a stable
machine-readable reason.
Detailed core error.
Most callers should branch on CoreError::kind or CoreError::code
instead of matching every internal variant.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MetadataProjection(MetadataProjectionLoadError)
MetadataView(MetadataViewError)
VisiblePath(VisiblePathError)
DurableContent(DurableContentValidationError)
WriterEpoch(WriterEpochAcquireError)
CommitValidation(CommitValidationError)
WalBuild(WalBuildError)
HeadPublish(CommitHeadPublishError)
WalWrite
InvalidPath(String)
InvalidNamespaceId(NamespaceIdValidationError)
InvalidCommitId(CommitIdValidationError)
InvalidCommitRequest(String)
InvalidUploadId(GeneratedIdValidationError)
PathNotFound(String)
RevisionNotFound
ContentTooLarge
A buffered content read was refused before any fetch: the resolved content is larger than the caller’s read budget allows in memory.
BatchTooLarge
A batch read asked for more items than one call answers. The caller splits the batch; nothing was read.
ResumeOffsetOutOfRange
A streamed read was asked to start past the end of the content it reads. Nothing was read.
ResumePrefixIncomplete
A streamed read that starts past zero was driven before the bytes it skipped were folded into its verification. Verification covers the whole object, so it cannot begin until the caller has handed over what it already holds. Nothing was read.
ExpectedFile
ExpectedDirectory
DirectoryNotEmpty(String)
RootMutationForbidden
DestinationExists
Fields
CommitIdReuseConflict
Fields
committed_seq: Option<ChangeSeq>Sequence the commit id already landed at, when the conflict was decided against a durable receipt — the receipt is what holds it. Absent when nothing has committed under the id yet and two live requests are claiming it at once, which is the one case a caller cannot reconcile by reading the feed.
committed_fingerprint: Option<String>Semantic identity of the mutation that landed under the id, taken
from the same receipt as committed_seq and present exactly when
it is. Reporting it is what lets a retry prove it is the same
request by recomputing one value, rather than comparing whichever
fields it thought to compare.
ContentPreparation(ContentPreparationError)
CommitQueueFull
ShuttingDown
The serving front-end closed admission for shutdown. New work is refused; work admitted earlier still settles.
InvalidCheckpointRequest(String)
MetadataPublicationBudgetExceeded
InvalidGcConfig(String)
InvalidQuery(String)
QueryUnindexable(String)
IndexLagging
UploadNotFound
UploadAlreadyCompleted
UploadContentConflict
InvalidUploadContent(String)
InvalidCursor(String)
RebootstrapRequired
NonDirectoryPathComponent(String)
NamespaceCorrupt(String)
WriterFenced(WriterFence)
This writer session’s epoch was superseded. Terminal for the session: callers surface it without reacquiring.
Store
Internal(String)
Non-store internal failure (codec, overflow, invariant breach). Same
wire code as ErrorCode::ServerError; the message is the detail.
NamespaceExists
Fields
namespace_id: NamespaceIdNamespaceDeleted
Fields
namespace_id: NamespaceIdStaleHeadPrecondition
A caller-supplied expected_head_seq did not match the head.
Distinct from the publish path’s CommitHeadPublishError::StaleHead,
which reports a race the caller never asked about: this is a
precondition the caller wrote, so the rejection owes it both numbers —
what it asked for and what the namespace was actually at — and a
caller that meant to delete the current head can retry against the
sequence it found. Both carry the stale_head code.
FailedOperation
A batch stopped at one of its operations. A mutation commits all of its operations or none of them, so this names the operation that stopped the request and carries the failure it produced. The wire code stays the inner failure’s; the position joins the message and the structured details.
Only a request with more than one operation is wrapped: a single-operation request has one place to fail, so its error stays exactly what the operation produced.
Implementations§
Source§impl CoreError
impl CoreError
pub fn kind(&self) -> ErrorKind
pub fn code(&self) -> ErrorCode
pub fn message(&self) -> String
Sourcepub fn details(&self) -> Option<ErrorDetails>
pub fn details(&self) -> Option<ErrorDetails>
Structured wire details for this error, when the variant carries
machine-usable identity (API spec, “Standard error contract”). The
server serializes this beside CoreError::code; embedded callers
can match the typed variants directly instead.
Trait Implementations§
Source§impl Error for CoreError
impl Error for CoreError
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 From<CommitHeadPublishError> for CoreError
impl From<CommitHeadPublishError> for CoreError
Source§fn from(source: CommitHeadPublishError) -> Self
fn from(source: CommitHeadPublishError) -> Self
Source§impl From<CommitIdValidationError> for CoreError
impl From<CommitIdValidationError> for CoreError
Source§fn from(source: CommitIdValidationError) -> Self
fn from(source: CommitIdValidationError) -> Self
Source§impl From<CommitValidationError> for CoreError
impl From<CommitValidationError> for CoreError
Source§fn from(source: CommitValidationError) -> Self
fn from(source: CommitValidationError) -> Self
Source§impl From<ContentPreparationError> for CoreError
impl From<ContentPreparationError> for CoreError
Source§fn from(source: ContentPreparationError) -> Self
fn from(source: ContentPreparationError) -> Self
Source§impl From<CoreError> for BootstrapNamespaceError
impl From<CoreError> for BootstrapNamespaceError
Source§impl From<DurableContentValidationError> for CoreError
impl From<DurableContentValidationError> for CoreError
Source§fn from(source: DurableContentValidationError) -> Self
fn from(source: DurableContentValidationError) -> Self
Source§impl From<GeneratedIdValidationError> for CoreError
impl From<GeneratedIdValidationError> for CoreError
Source§fn from(source: GeneratedIdValidationError) -> Self
fn from(source: GeneratedIdValidationError) -> Self
Source§impl From<ImmutableWriteError> for CoreError
impl From<ImmutableWriteError> for CoreError
Source§fn from(value: ImmutableWriteError) -> Self
fn from(value: ImmutableWriteError) -> Self
Source§impl From<MetadataProjectionLoadError> for CoreError
impl From<MetadataProjectionLoadError> for CoreError
Source§fn from(source: MetadataProjectionLoadError) -> Self
fn from(source: MetadataProjectionLoadError) -> Self
Source§impl From<MetadataViewError> for CoreError
impl From<MetadataViewError> for CoreError
Source§fn from(source: MetadataViewError) -> Self
fn from(source: MetadataViewError) -> Self
Source§impl From<NamespaceCatalogLoadError> for CoreError
impl From<NamespaceCatalogLoadError> for CoreError
Source§fn from(value: NamespaceCatalogLoadError) -> Self
fn from(value: NamespaceCatalogLoadError) -> Self
Source§impl From<NamespaceIdValidationError> for CoreError
impl From<NamespaceIdValidationError> for CoreError
Source§fn from(source: NamespaceIdValidationError) -> Self
fn from(source: NamespaceIdValidationError) -> Self
Source§impl From<VisiblePathError> for CoreError
impl From<VisiblePathError> for CoreError
Source§fn from(source: VisiblePathError) -> Self
fn from(source: VisiblePathError) -> Self
Auto Trait Implementations§
impl Freeze for CoreError
impl RefUnwindSafe for CoreError
impl Send for CoreError
impl Sync for CoreError
impl Unpin for CoreError
impl UnsafeUnpin for CoreError
impl UnwindSafe for CoreError
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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