Skip to main content

ErrorHandler

Trait ErrorHandler 

Source
pub trait ErrorHandler {
    // Required methods
    fn handle_error(&self, error: &FormError, context: &ErrorContext);
    fn should_log_error(&self, error: &FormError) -> bool;
    fn should_report_error(&self, error: &FormError) -> bool;
}
Expand description

Error handler trait for custom error handling

Required Methods§

Source

fn handle_error(&self, error: &FormError, context: &ErrorContext)

Handle a form error

Source

fn should_log_error(&self, error: &FormError) -> bool

Check if an error should be logged

Source

fn should_report_error(&self, error: &FormError) -> bool

Check if an error should be reported to external services

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§