pub enum AtrgError {
Database(Error),
Auth(String),
NotFound,
BadRequest(String),
Internal(Error),
}Expand description
Unified error type for atrg handlers.
Each variant maps to a specific HTTP status code and a JSON error envelope.
Variants§
Database(Error)
A database operation failed. Maps to 500 Internal Server Error.
The underlying error is logged but NOT exposed to clients.
Auth(String)
The request requires authentication but none was provided or the
credentials were invalid. Maps to 401 Unauthorized.
NotFound
The requested resource was not found. Maps to 404 Not Found.
BadRequest(String)
The request was malformed or contained invalid parameters.
Maps to 400 Bad Request.
Internal(Error)
A catch-all for unexpected internal errors. Maps to 500 Internal Server Error.
The underlying error is logged but NOT exposed to clients.
Trait Implementations§
Source§impl Error for AtrgError
impl Error for AtrgError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for AtrgError
impl !RefUnwindSafe for AtrgError
impl Send for AtrgError
impl Sync for AtrgError
impl Unpin for AtrgError
impl UnsafeUnpin for AtrgError
impl !UnwindSafe for AtrgError
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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 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>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.