pub struct ErrorHandlerMiddleware { /* private fields */ }Implementations§
Source§impl ErrorHandlerMiddleware
impl ErrorHandlerMiddleware
pub fn new() -> Self
Sourcepub fn with_details(self, include: bool) -> Self
pub fn with_details(self, include: bool) -> Self
Enable/disable detailed error information in responses
Sourcepub fn with_stack_trace(self, include: bool) -> Self
pub fn with_stack_trace(self, include: bool) -> Self
Enable/disable stack traces in error responses
Sourcepub fn with_custom_error_page(self, status: StatusCode, html: String) -> Self
pub fn with_custom_error_page(self, status: StatusCode, html: String) -> Self
Add a custom error page for a specific status code
Sourcepub fn with_logging(self, enabled: bool) -> Self
pub fn with_logging(self, enabled: bool) -> Self
Enable/disable error logging
Sourcepub fn with_error_log_threshold(self, threshold: u16) -> Self
pub fn with_error_log_threshold(self, threshold: u16) -> Self
Set the threshold for error vs warning logs (default: 500)
Trait Implementations§
Source§impl Default for ErrorHandlerMiddleware
impl Default for ErrorHandlerMiddleware
Source§impl Middleware for ErrorHandlerMiddleware
impl Middleware for ErrorHandlerMiddleware
fn after<'life0, 'life1, 'async_trait>(
&'life0 self,
res: &'life1 mut Response,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn before<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: &'life1 mut Request,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for ErrorHandlerMiddleware
impl RefUnwindSafe for ErrorHandlerMiddleware
impl Send for ErrorHandlerMiddleware
impl Sync for ErrorHandlerMiddleware
impl Unpin for ErrorHandlerMiddleware
impl UnwindSafe for ErrorHandlerMiddleware
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