pub struct ErrorHandler;
Expand description
Error handler middleware
Implementations§
Source§impl ErrorHandler
impl ErrorHandler
Sourcepub fn handle(error: RustisanError) -> AxumResponse
pub fn handle(error: RustisanError) -> AxumResponse
Handles errors and converts them to appropriate HTTP responses
Sourcepub fn not_found() -> AxumResponse
pub fn not_found() -> AxumResponse
Creates a generic 404 response
Sourcepub fn internal_server_error() -> AxumResponse
pub fn internal_server_error() -> AxumResponse
Creates a generic 500 response
Auto Trait Implementations§
impl Freeze for ErrorHandler
impl RefUnwindSafe for ErrorHandler
impl Send for ErrorHandler
impl Sync for ErrorHandler
impl Unpin for ErrorHandler
impl UnwindSafe for ErrorHandler
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