Trait flutter_rust_bridge::handler::ErrorHandler
source · pub trait ErrorHandler: UnwindSafe + RefUnwindSafe + Copy + Send + 'static {
fn handle_error(&self, port: MessagePort, error: Error);
fn handle_error_sync(&self, error: Error) -> WireSyncReturnStruct;
}
Expand description
A handler model that sends back the error to a Dart SendPort
.
For example, instead of using the default ReportDartErrorHandler
,
you could implement your own handler that logs each error to stderr,
or to an external logging service.
Required Methods§
sourcefn handle_error(&self, port: MessagePort, error: Error)
fn handle_error(&self, port: MessagePort, error: Error)
The default error handler.
sourcefn handle_error_sync(&self, error: Error) -> WireSyncReturnStruct
fn handle_error_sync(&self, error: Error) -> WireSyncReturnStruct
Special handler only used for synchronous code.