pub enum Error {
Show 24 variants
BadRequest(String),
JobNotFound,
NotFound(String),
JobNotFinished,
RenderFailed(String),
Multipart(MultipartError),
USBNotecardParse(LocationParseError),
USBNotecardLoad(USBNotecardLoadError),
RegionCache(Box<CacheError>),
USBNotecardToGridRectangle(Box<USBNotecardToGridRectangleError>),
Map(Box<MapError>),
MapTileCache(Box<MapTileCacheError>),
Image(Box<ImageError>),
Io(Error),
Json(Error),
Unauthenticated,
Forbidden(String),
InvalidCredentials,
InvalidOrExpiredToken,
Database,
PasswordHash(String),
TooManyRequests {
retry_after_secs: u64,
},
GlwEventCache(GlwEventCacheError),
FontParse(InvalidFont),
}Expand description
Top-level error for the web service. Wraps the various library and IO
errors so that handlers can use ? and the central IntoResponse impl
turns them into HTTP responses.
The bigger inner errors (MapError, MapTileCacheError,
USBNotecardToGridRectangleError) are boxed so the discriminant stays
small and Result<T, Error> doesn’t blow up in size.
Variants§
BadRequest(String)
the request body could not be parsed.
JobNotFound
the requested job id is unknown or has been evicted.
NotFound(String)
the request asked for a part of a job that does not exist (e.g.
image-without-route when no without-route image was saved).
JobNotFinished
the job is still running; the requested artifact is not ready yet.
RenderFailed(String)
the underlying render job failed with the given message.
Multipart(MultipartError)
multipart upload parsing failed.
USBNotecardParse(LocationParseError)
a USB notecard line could not be parsed.
USBNotecardLoad(USBNotecardLoadError)
loading a USB notecard from disk failed (only used by the loader helper).
RegionCache(Box<CacheError>)
the region name to grid coordinates cache failed.
USBNotecardToGridRectangle(Box<USBNotecardToGridRectangleError>)
converting a USB notecard to a grid rectangle failed.
Map(Box<MapError>)
the map renderer returned an error.
MapTileCache(Box<MapTileCacheError>)
the map tile cache returned an error.
Image(Box<ImageError>)
image encoding failed.
Io(Error)
generic I/O error.
Json(Error)
JSON serialization failed.
Unauthenticated
the request lacks a valid session cookie or bearer token.
Forbidden(String)
the authenticated user is not permitted to perform this action.
InvalidCredentials
the credentials presented at login do not match a known user.
InvalidOrExpiredToken
the set-password / reset token is missing, malformed, used, or expired.
Database
a database operation failed. Detail is logged via tracing to avoid
leaking internals over HTTP.
PasswordHash(String)
argon2 hashing or verification failed.
TooManyRequests
the caller exhausted their per-user token bucket for a
rate-limited create endpoint. The wrapped value is the number of
seconds the client should wait before retrying; it is also
emitted as a Retry-After HTTP header.
GlwEventCache(GlwEventCacheError)
error in the GLW event cache (HTTP fetch / on-disk redb / JSON).
FontParse(InvalidFont)
error parsing a TrueType font file.
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 From<CacheError> for Error
impl From<CacheError> for Error
Source§fn from(value: RegionCacheError) -> Self
fn from(value: RegionCacheError) -> Self
Source§impl From<GlwEventCacheError> for Error
impl From<GlwEventCacheError> for Error
Source§fn from(source: GlwEventCacheError) -> Self
fn from(source: GlwEventCacheError) -> Self
Source§impl From<ImageError> for Error
impl From<ImageError> for Error
Source§fn from(value: ImageError) -> Self
fn from(value: ImageError) -> Self
Source§impl From<InvalidFont> for Error
impl From<InvalidFont> for Error
Source§fn from(source: InvalidFont) -> Self
fn from(source: InvalidFont) -> Self
Source§impl From<LocationParseError> for Error
impl From<LocationParseError> for Error
Source§fn from(source: LocationParseError) -> Self
fn from(source: LocationParseError) -> Self
Source§impl From<MapTileCacheError> for Error
impl From<MapTileCacheError> for Error
Source§fn from(value: MapTileCacheError) -> Self
fn from(value: MapTileCacheError) -> Self
Source§impl From<MultipartError> for Error
impl From<MultipartError> for Error
Source§fn from(source: MultipartError) -> Self
fn from(source: MultipartError) -> Self
Source§impl From<USBNotecardLoadError> for Error
impl From<USBNotecardLoadError> for Error
Source§fn from(source: USBNotecardLoadError) -> Self
fn from(source: USBNotecardLoadError) -> Self
Source§impl From<USBNotecardToGridRectangleError> for Error
impl From<USBNotecardToGridRectangleError> for Error
Source§fn from(value: USBNotecardToGridRectangleError) -> Self
fn from(value: USBNotecardToGridRectangleError) -> Self
Source§impl IntoResponse for Error
impl IntoResponse for Error
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.