pub enum AppError {
Config(Box<dyn Error + Sync + Send>),
NotFound,
Internal(Box<dyn Error + Sync + Send>),
Http {
status: StatusCode,
message: String,
},
}Expand description
Re-exported (not just used internally) so macro-generated code can
reference ::larust_support::axum::.../::larust_support::AppError
instead of ::larust_core::... - a crate depending on larust-support
alone must not need larust-core as a direct dependency just to use
a macro. Keep every path in larust-macros’ generated code routed
through larust_support for the same reason. default_not_found_html/
default_internal_html are error_view!’s own fallback when no
resources/views/errors/{code}.blade.xr override exists.
The framework’s primary error type.
HTTP responses for Config/Internal only ever expose a generic
message - unless APP_DEBUG=true (see the debug module), in which
case the full message and source chain are rendered as an HTML page
instead. The wrapped source error (with full detail) is always logged
via tracing regardless of debug mode. Never enable APP_DEBUG outside
local development - see docs/GOTCHAS.md.
Variants§
Config(Box<dyn Error + Sync + Send>)
NotFound
Internal(Box<dyn Error + Sync + Send>)
Http
A specific HTTP status with a message safe to show clients (Laravel’s
abort()). Unlike Config/Internal, this message is sent as-is -
callers are responsible for not putting sensitive detail in it.
Trait Implementations§
Source§impl Error for AppError
impl Error for AppError
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 IntoResponse for AppError
impl IntoResponse for AppError
Source§fn into_response(self) -> Response<Body>
fn into_response(self) -> Response<Body>
Auto Trait Implementations§
impl !RefUnwindSafe for AppError
impl !UnwindSafe for AppError
impl Forget for AppError
impl Freeze for AppError
impl Move for AppError
impl Send for AppError
impl Sync for AppError
impl Unpin for AppError
impl UnsafeUnpin for AppError
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<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 more