pub enum ServerError {
Show 54 variants
Io(Error),
Json(Error),
RequestBodyRead(Error),
RequestBodyTooLarge,
RequestQueryTooLarge,
RequestBodyFrameOutOfBounds,
NumericConversion(TryFromIntError),
HashParse(HashParseError),
ObjectStore(ObjectStoreError),
Index(IndexError),
StoredFileMetadataTooLarge {
observed_bytes: u64,
maximum_bytes: u64,
},
StoredFileMetadataLengthMismatch,
InvalidFileId,
InvalidContentHash,
InvalidXorbPrefix,
XorbHashMismatch,
InvalidSerializedXorb,
InvalidSerializedShard(InvalidSerializedShardError),
MissingReferencedXorb,
TooManyShardTerms,
TooManyBatchReconstructionFileIds,
NotFound,
Overflow,
InvalidRangeHeader,
RangeNotSatisfiable,
MissingAuthorization,
InvalidAuthorizationHeader,
InvalidToken(TokenCodecError),
InsufficientScope,
ProviderTokensDisabled,
MissingProviderApiKey,
InvalidProviderApiKey,
MissingProviderSubject,
InvalidProviderTokenRequest,
MissingProviderWebhookAuthentication,
InvalidProviderWebhookAuthentication,
InvalidProviderWebhookPayload,
UnknownProvider,
ProviderDenied,
Provider(ProviderServiceError),
ReconstructionCache(ReconstructionCacheError),
Config(ServerConfigError),
ExpectedBodyHashMismatch,
InvalidDigest,
InvalidRepositoryName,
InvalidManifestReference,
NotAcceptable,
UnauthorizedChallenge(String),
InvalidUploadSession,
TooManyUploadSessions,
TooManyRegistryTokenRequests,
MissingReconstructionCacheRedisUrl,
TransferLimiterClosed,
BlockingTask(JoinError),
}Expand description
Server runtime failure.
This is the unified error type for the Shardline server layer. It maps domain-specific errors from storage, indexing, protocol, auth, and OCI subsystems into a single enum with HTTP status code mapping.
§Design
Each variant maps to exactly one HTTP status code via ServerError::status_code.
Subsystem errors (e.g., LocalIndexStoreError, S3ObjectStoreError) are
converted via From implementations for ergonomic ? usage.
When adding new error sources, prefer adding a new variant with a #[from]
attribute over manual From implementations unless the source error maps
to multiple variants.
Variants§
Io(Error)
Local storage IO failed.
Json(Error)
JSON serialization or deserialization failed.
RequestBodyRead(Error)
Request body streaming failed.
RequestBodyTooLarge
Request body exceeded the configured maximum accepted byte count.
RequestQueryTooLarge
Request query exceeded the bounded metadata parser budget.
RequestBodyFrameOutOfBounds
Request body frame slicing exceeded checked bounds.
NumericConversion(TryFromIntError)
Numeric conversion exceeded supported bounds.
HashParse(HashParseError)
Hash parsing failed.
ObjectStore(ObjectStoreError)
Object-storage subsystem failure.
Index(IndexError)
Metadata index subsystem failure.
StoredFileMetadataTooLarge
Stored file metadata exceeded the bounded parser ceiling.
Fields
StoredFileMetadataLengthMismatch
Stored file metadata changed after bounded validation.
InvalidFileId
A file identifier was unsafe.
InvalidContentHash
A content hash was malformed.
InvalidXorbPrefix
The xorb transfer path prefix was unsupported.
XorbHashMismatch
The uploaded xorb bytes did not match the requested hash.
InvalidSerializedXorb
The uploaded xorb bytes were not a valid serialized xorb object.
InvalidSerializedShard(InvalidSerializedShardError)
The uploaded shard bytes were not a valid serialized shard object.
MissingReferencedXorb
A shard upload referenced a missing xorb.
TooManyShardTerms
Shard metadata exceeded bounded parser safety limits.
TooManyBatchReconstructionFileIds
Batch reconstruction requested too many file identifiers.
NotFound
Requested content was not found.
Overflow
Arithmetic overflowed a checked bound.
InvalidRangeHeader
The reconstruction range header was malformed.
RangeNotSatisfiable
The reconstruction range start exceeded the end of the file.
MissingAuthorization
The request did not include an authorization header.
InvalidAuthorizationHeader
The authorization header was malformed.
InvalidToken(TokenCodecError)
The bearer token was invalid.
InsufficientScope
The bearer token did not grant the required scope.
ProviderTokensDisabled
The provider issuance endpoint is not configured.
MissingProviderApiKey
The provider bootstrap key was missing.
InvalidProviderApiKey
The provider bootstrap key was invalid.
MissingProviderSubject
The provider subject was missing from a bootstrap request.
InvalidProviderTokenRequest
The provider token issuance request contained invalid bounded metadata.
MissingProviderWebhookAuthentication
The provider webhook authentication header was missing.
InvalidProviderWebhookAuthentication
The provider webhook authentication header was invalid.
InvalidProviderWebhookPayload
The provider webhook payload was invalid.
UnknownProvider
The requested provider is not configured.
ProviderDenied
Provider authorization denied the request.
Provider(ProviderServiceError)
Provider token issuance failed due to configuration or adapter errors.
ReconstructionCache(ReconstructionCacheError)
Reconstruction cache adapter access failed.
Config(ServerConfigError)
Server configuration was invalid for the selected runtime surface.
ExpectedBodyHashMismatch
The uploaded body did not match the expected SHA-256 identifier.
InvalidDigest
A digest string was malformed.
InvalidRepositoryName
A repository name or namespace path was malformed.
InvalidManifestReference
A manifest reference or tag was malformed.
NotAcceptable
The requested representation does not match any accepted media type.
The request requires a protocol-specific authentication challenge.
InvalidUploadSession
An upload session identifier was malformed.
TooManyUploadSessions
Too many OCI upload sessions are currently active.
TooManyRegistryTokenRequests
Too many OCI registry token exchanges are currently active.
MissingReconstructionCacheRedisUrl
Redis reconstruction cache was selected without a URL.
TransferLimiterClosed
The transfer concurrency limiter was unexpectedly unavailable.
BlockingTask(JoinError)
A blocking worker task failed before it could finish storage work.
Trait Implementations§
Source§impl Debug for ServerError
impl Debug for ServerError
Source§impl Display for ServerError
impl Display for ServerError
Source§impl Error for ServerError
impl Error for ServerError
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<AuthError> for ServerError
impl From<AuthError> for ServerError
Source§impl From<Error> for ServerError
impl From<Error> for ServerError
Source§impl From<Error> for ServerError
impl From<Error> for ServerError
Source§impl From<FileRecordInvariantError> for ServerError
impl From<FileRecordInvariantError> for ServerError
Source§fn from(e: FileRecordInvariantError) -> Self
fn from(e: FileRecordInvariantError) -> Self
Source§impl From<FsckError> for ServerError
impl From<FsckError> for ServerError
Source§impl From<GcError> for ServerError
impl From<GcError> for ServerError
Source§impl From<HashParseError> for ServerError
impl From<HashParseError> for ServerError
Source§fn from(source: HashParseError) -> Self
fn from(source: HashParseError) -> Self
Source§impl From<HttpRangeParseError> for ServerError
impl From<HttpRangeParseError> for ServerError
Source§fn from(value: HttpRangeParseError) -> Self
fn from(value: HttpRangeParseError) -> Self
Source§impl From<InvalidLifecycleMetadataError> for ServerError
impl From<InvalidLifecycleMetadataError> for ServerError
Source§fn from(e: InvalidLifecycleMetadataError) -> Self
fn from(e: InvalidLifecycleMetadataError) -> Self
Source§impl From<InvalidReconstructionResponseError> for ServerError
impl From<InvalidReconstructionResponseError> for ServerError
Source§fn from(e: InvalidReconstructionResponseError) -> Self
fn from(e: InvalidReconstructionResponseError) -> Self
Source§impl From<InvalidSerializedShardError> for ServerError
impl From<InvalidSerializedShardError> for ServerError
Source§fn from(source: InvalidSerializedShardError) -> Self
fn from(source: InvalidSerializedShardError) -> Self
Source§impl From<LocalIndexStoreError> for ServerError
impl From<LocalIndexStoreError> for ServerError
Source§fn from(e: LocalIndexStoreError) -> Self
fn from(e: LocalIndexStoreError) -> Self
Source§impl From<LocalObjectStoreError> for ServerError
impl From<LocalObjectStoreError> for ServerError
Source§fn from(e: LocalObjectStoreError) -> Self
fn from(e: LocalObjectStoreError) -> Self
Source§impl From<MemoryIndexStoreError> for ServerError
impl From<MemoryIndexStoreError> for ServerError
Source§fn from(e: MemoryIndexStoreError) -> Self
fn from(e: MemoryIndexStoreError) -> Self
Source§impl From<MemoryRecordStoreError> for ServerError
impl From<MemoryRecordStoreError> for ServerError
Source§fn from(e: MemoryRecordStoreError) -> Self
fn from(e: MemoryRecordStoreError) -> Self
Source§impl From<ObjectPrefixError> for ServerError
impl From<ObjectPrefixError> for ServerError
Source§fn from(e: ObjectPrefixError) -> Self
fn from(e: ObjectPrefixError) -> Self
Source§impl From<OciAdapterError> for ServerError
impl From<OciAdapterError> for ServerError
Source§fn from(value: OciAdapterError) -> Self
fn from(value: OciAdapterError) -> Self
Source§impl From<ParseStoredFileRecordError> for ServerError
impl From<ParseStoredFileRecordError> for ServerError
Source§fn from(e: ParseStoredFileRecordError) -> Self
fn from(e: ParseStoredFileRecordError) -> Self
Source§impl From<PostgresMetadataStoreError> for ServerError
impl From<PostgresMetadataStoreError> for ServerError
Source§fn from(e: PostgresMetadataStoreError) -> Self
fn from(e: PostgresMetadataStoreError) -> Self
Source§impl From<ProtocolError> for ServerError
impl From<ProtocolError> for ServerError
Source§fn from(error: ProtocolError) -> Self
fn from(error: ProtocolError) -> Self
Source§impl From<ProviderEventsError> for ServerError
impl From<ProviderEventsError> for ServerError
Source§fn from(value: ProviderEventsError) -> Self
fn from(value: ProviderEventsError) -> Self
Source§impl From<QuarantineCandidateError> for ServerError
impl From<QuarantineCandidateError> for ServerError
Source§fn from(e: QuarantineCandidateError) -> Self
fn from(e: QuarantineCandidateError) -> Self
Source§impl From<RebuildError> for ServerError
impl From<RebuildError> for ServerError
Source§fn from(value: RebuildError) -> Self
fn from(value: RebuildError) -> Self
Source§impl From<ReconstructionCacheError> for ServerError
impl From<ReconstructionCacheError> for ServerError
Source§fn from(source: ReconstructionCacheError) -> Self
fn from(source: ReconstructionCacheError) -> Self
Source§impl From<RetentionHoldError> for ServerError
impl From<RetentionHoldError> for ServerError
Source§fn from(e: RetentionHoldError) -> Self
fn from(e: RetentionHoldError) -> Self
Source§impl From<S3ObjectStoreError> for ServerError
impl From<S3ObjectStoreError> for ServerError
Source§fn from(e: S3ObjectStoreError) -> Self
fn from(e: S3ObjectStoreError) -> Self
Source§impl From<ServerConfigError> for ServerError
impl From<ServerConfigError> for ServerError
Source§fn from(source: ServerConfigError) -> Self
fn from(source: ServerConfigError) -> Self
Source§impl From<ServerObjectStoreError> for ServerError
impl From<ServerObjectStoreError> for ServerError
Source§fn from(value: ServerObjectStoreError) -> Self
fn from(value: ServerObjectStoreError) -> Self
Source§impl From<TokenCodecError> for ServerError
impl From<TokenCodecError> for ServerError
Source§fn from(error: TokenCodecError) -> Self
fn from(error: TokenCodecError) -> Self
Source§impl From<TryFromIntError> for ServerError
impl From<TryFromIntError> for ServerError
Source§fn from(source: TryFromIntError) -> Self
fn from(source: TryFromIntError) -> Self
Source§impl From<WebhookDeliveryError> for ServerError
impl From<WebhookDeliveryError> for ServerError
Source§fn from(e: WebhookDeliveryError) -> Self
fn from(e: WebhookDeliveryError) -> Self
Source§impl From<XetAdapterError> for ServerError
impl From<XetAdapterError> for ServerError
Source§fn from(value: XetAdapterError) -> Self
fn from(value: XetAdapterError) -> Self
Source§impl From<XorbParseError> for ServerError
impl From<XorbParseError> for ServerError
Source§fn from(value: XorbParseError) -> Self
fn from(value: XorbParseError) -> Self
Source§impl IntoResponse for ServerError
impl IntoResponse for ServerError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Source§impl ProtocolValidation for ServerError
impl ProtocolValidation for ServerError
fn invalid_digest() -> Self
fn invalid_content_hash() -> Self
fn invalid_repository_name() -> Self
fn not_found() -> Self
fn invalid_manifest_reference() -> Self
fn invalid_upload_session() -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for ServerError
impl !UnwindSafe for ServerError
impl Freeze for ServerError
impl Send for ServerError
impl Sync for ServerError
impl Unpin for ServerError
impl UnsafeUnpin for ServerError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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