pub struct Error(/* private fields */);Expand description
A failure answered as the REST API would answer it.
Wraps the postrust_core::Error the REST pipeline reports with, so its
status and body come from the same table: a database error by its
SQLSTATE (23505 is 409, 42501 a missing grant is 401, P0001 a bare
RAISE is 400), a refusal raised with sqlstate 'PGRST' with the status,
headers and body the function wrote, a broken connection as 503.
The database’s own account of an error – its message, detail and hint,
which name constraints and columns – is passed through only where the
REST API would pass it through: in compatibility mode (PGRST_COMPAT_MODE)
or with PGRST_DEBUG. Compatibility mode is the server’s configuration, which
an error converted by ? has no way to reach, so it is applied on the way
out by the routers given to Builder::nest. A
router served some other way gets the sanitised body.
Implementations§
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<Error> for Error
Through the driver-neutral DbError, as the
REST pipeline’s own sqlx errors go: a statement PostgreSQL refused keeps
its SQLSTATE, a connection that broke or could not be had from the pool is
the database being unavailable, anything else is internal.
impl From<Error> for Error
Through the driver-neutral DbError, as the
REST pipeline’s own sqlx errors go: a statement PostgreSQL refused keeps
its SQLSTATE, a connection that broke or could not be had from the pool is
the database being unavailable, anything else is internal.
Source§impl IntoResponse for Error
impl IntoResponse for Error
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe 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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreimpl<T> MaybeSend for T
impl<T> MaybeSendSync for T
impl<T> MaybeSync for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.