Skip to main content

ServerError

Enum ServerError 

Source
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

§observed_bytes: u64

Observed file length in bytes.

§maximum_bytes: u64

Maximum accepted file length in bytes.

§

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.

§

UnauthorizedChallenge(String)

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

Source§

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

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

impl Display for ServerError

Source§

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

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

impl Error for ServerError

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<AuthError> for ServerError

Source§

fn from(error: AuthError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ServerError

Source§

fn from(source: IoError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ServerError

Source§

fn from(source: JsonError) -> Self

Converts to this type from the input type.
Source§

impl From<FileRecordInvariantError> for ServerError

Source§

fn from(e: FileRecordInvariantError) -> Self

Converts to this type from the input type.
Source§

impl From<FsckError> for ServerError

Source§

fn from(value: FsckError) -> Self

Converts to this type from the input type.
Source§

impl From<GcError> for ServerError

Source§

fn from(err: GcError) -> Self

Converts to this type from the input type.
Source§

impl From<HashParseError> for ServerError

Source§

fn from(source: HashParseError) -> Self

Converts to this type from the input type.
Source§

impl From<HttpRangeParseError> for ServerError

Source§

fn from(value: HttpRangeParseError) -> Self

Converts to this type from the input type.
Source§

impl From<InvalidLifecycleMetadataError> for ServerError

Source§

fn from(e: InvalidLifecycleMetadataError) -> Self

Converts to this type from the input type.
Source§

impl From<InvalidReconstructionResponseError> for ServerError

Source§

fn from(e: InvalidReconstructionResponseError) -> Self

Converts to this type from the input type.
Source§

impl From<InvalidSerializedShardError> for ServerError

Source§

fn from(source: InvalidSerializedShardError) -> Self

Converts to this type from the input type.
Source§

impl From<LocalIndexStoreError> for ServerError

Source§

fn from(e: LocalIndexStoreError) -> Self

Converts to this type from the input type.
Source§

impl From<LocalObjectStoreError> for ServerError

Source§

fn from(e: LocalObjectStoreError) -> Self

Converts to this type from the input type.
Source§

impl From<MemoryIndexStoreError> for ServerError

Source§

fn from(e: MemoryIndexStoreError) -> Self

Converts to this type from the input type.
Source§

impl From<MemoryRecordStoreError> for ServerError

Source§

fn from(e: MemoryRecordStoreError) -> Self

Converts to this type from the input type.
Source§

impl From<ObjectPrefixError> for ServerError

Source§

fn from(e: ObjectPrefixError) -> Self

Converts to this type from the input type.
Source§

impl From<OciAdapterError> for ServerError

Source§

fn from(value: OciAdapterError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseStoredFileRecordError> for ServerError

Source§

fn from(e: ParseStoredFileRecordError) -> Self

Converts to this type from the input type.
Source§

impl From<PostgresMetadataStoreError> for ServerError

Source§

fn from(e: PostgresMetadataStoreError) -> Self

Converts to this type from the input type.
Source§

impl From<ProtocolError> for ServerError

Source§

fn from(error: ProtocolError) -> Self

Converts to this type from the input type.
Source§

impl From<ProviderEventsError> for ServerError

Source§

fn from(value: ProviderEventsError) -> Self

Converts to this type from the input type.
Source§

impl From<QuarantineCandidateError> for ServerError

Source§

fn from(e: QuarantineCandidateError) -> Self

Converts to this type from the input type.
Source§

impl From<RebuildError> for ServerError

Source§

fn from(value: RebuildError) -> Self

Converts to this type from the input type.
Source§

impl From<ReconstructionCacheError> for ServerError

Source§

fn from(source: ReconstructionCacheError) -> Self

Converts to this type from the input type.
Source§

impl From<RetentionHoldError> for ServerError

Source§

fn from(e: RetentionHoldError) -> Self

Converts to this type from the input type.
Source§

impl From<S3ObjectStoreError> for ServerError

Source§

fn from(e: S3ObjectStoreError) -> Self

Converts to this type from the input type.
Source§

impl From<ServerConfigError> for ServerError

Source§

fn from(source: ServerConfigError) -> Self

Converts to this type from the input type.
Source§

impl From<ServerObjectStoreError> for ServerError

Source§

fn from(value: ServerObjectStoreError) -> Self

Converts to this type from the input type.
Source§

impl From<TokenCodecError> for ServerError

Source§

fn from(error: TokenCodecError) -> Self

Converts to this type from the input type.
Source§

impl From<TryFromIntError> for ServerError

Source§

fn from(source: TryFromIntError) -> Self

Converts to this type from the input type.
Source§

impl From<WebhookDeliveryError> for ServerError

Source§

fn from(e: WebhookDeliveryError) -> Self

Converts to this type from the input type.
Source§

impl From<XetAdapterError> for ServerError

Source§

fn from(value: XetAdapterError) -> Self

Converts to this type from the input type.
Source§

impl From<XorbParseError> for ServerError

Source§

fn from(value: XorbParseError) -> Self

Converts to this type from the input type.
Source§

impl IntoResponse for ServerError

Source§

fn into_response(self) -> Response

Create a response.
Source§

impl ProtocolValidation for ServerError

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ServiceExt for T

Source§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
Source§

fn override_request_header<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Insert a header into the request. Read more
Source§

fn append_request_header<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Append a header into the request. Read more
Source§

fn insert_request_header_if_not_present<M>( self, header_name: HeaderName, make: M, ) -> SetRequestHeader<Self, M>
where Self: Sized,

Insert a header into the request, if the header is not already present. Read more
Source§

fn override_response_header<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Insert a header into the response. Read more
Source§

fn append_response_header<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Append a header into the response. Read more
Source§

fn insert_response_header_if_not_present<M>( self, header_name: HeaderName, make: M, ) -> SetResponseHeader<Self, M>
where Self: Sized,

Insert a header into the response, if the header is not already present. Read more
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