pub trait ErrorObserver: Send + Sync {
// Required method
fn on_error(&self, scope: ErrorScope, err: &EventBusError);
// Provided method
fn on_panic(&self, _scope: ErrorScope, _payload: &str) { ... }
}Expand description
Receives bus-level transient errors so they can be surfaced to metrics or tracing.
Implementations must not block — the hook is called from inside the consume / reclaim / ack loops. Push the event onto a queue or counter and return.
Required Methods§
fn on_error(&self, scope: ErrorScope, err: &EventBusError)
Provided Methods§
Sourcefn on_panic(&self, _scope: ErrorScope, _payload: &str)
fn on_panic(&self, _scope: ErrorScope, _payload: &str)
Called when a delivery task panics. Default empty for backwards compatibility — implementors can override to route to crash metrics.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".