pub enum ApiError {
Unauthorized,
IndexerBackpressureUpsert,
IndexerBackpressureTombstone,
Core(Error),
Storage(StorageError),
PreconditionFailed,
RangeNotSatisfiable {
complete_length: u64,
},
NotModified,
MalformedRange(String),
LineRangeNotSatisfiable {
line_total: u64,
byte_total: u64,
},
ReplaceNoMatch,
ReplaceAmbiguous {
count: u64,
},
}Expand description
HTTP-layer error — maps domain and storage errors to HTTP status codes.
Variants§
The request lacked valid Bearer credentials.
IndexerBackpressureUpsert
Indexer queue was full while enqueueing an upsert (PUT/COPY).
IndexerBackpressureTombstone
Indexer queue was full while enqueueing a tombstone (DELETE).
Core(Error)
A domain error from notedthat-core.
Storage(StorageError)
A storage-layer error not otherwise promoted to a top-level variant.
Note: StorageError::NotModified, StorageError::PreconditionFailed, and
StorageError::RangeNotSatisfiable are promoted via the manual From<StorageError>
impl to top-level ApiError variants so that IntoResponse can emit the
RFC-required headers (e.g. Content-Range: bytes */N for 416).
PreconditionFailed
A conditional PUT/DELETE failed because a precondition was not met.
Maps to HTTP 412 Precondition Failed.
RangeNotSatisfiable
The requested byte range could not be satisfied.
complete_length is the total object size in bytes. The IntoResponse
impl emits Content-Range: bytes */complete_length per RFC 7233 §4.4.
NotModified
The backend returned 304 Not Modified for a conditional GET/HEAD.
Maps to HTTP 304 with no body, as required by RFC 7232 §4.1.
MalformedRange(String)
The Range: header value could not be parsed per RFC 7233.
Maps to HTTP 400 Bad Request.
LineRangeNotSatisfiable
A Range: lines=… header specified a range that exceeds the object’s line count.
Maps to HTTP 416 with Content-Range: lines */<line_total> and
X-Content-Range-Bytes: */<byte_total> per the line-range extension.
Fields
ReplaceNoMatch
A single-replace operation found no occurrence of old_string.
ReplaceAmbiguous
A single-replace operation found multiple occurrences of old_string.
Trait Implementations§
Source§impl Error for ApiError
impl Error for ApiError
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<StorageError> for ApiError
Promote specific StorageError variants to top-level ApiError variants so
that IntoResponse can emit the RFC-mandated response headers.
impl From<StorageError> for ApiError
Promote specific StorageError variants to top-level ApiError variants so
that IntoResponse can emit the RFC-mandated response headers.
Source§fn from(e: StorageError) -> Self
fn from(e: StorageError) -> Self
Source§impl From<WriteError> for ApiError
impl From<WriteError> for ApiError
Source§fn from(e: WriteError) -> Self
fn from(e: WriteError) -> Self
Source§impl IntoResponse for ApiError
impl IntoResponse for ApiError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Auto Trait Implementations§
impl !RefUnwindSafe for ApiError
impl !UnwindSafe for ApiError
impl Freeze for ApiError
impl Send for ApiError
impl Sync for ApiError
impl Unpin for ApiError
impl UnsafeUnpin for ApiError
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request