pub enum EventBusError {
Show 14 variants
NotStarted,
StartFailed {
message: String,
},
InvalidArgument {
field: &'static str,
message: String,
},
MissingField {
field: &'static str,
},
HandlerFailed {
message: String,
},
HandlerPanicked,
InterceptorFailed {
phase: &'static str,
message: String,
},
ErrorHandlerFailed {
phase: &'static str,
message: String,
},
DeadLetterFailed {
message: String,
},
ExecutionRejected {
message: String,
},
ShutdownTimedOut {
timeout: Duration,
},
LockPoisoned {
resource: &'static str,
},
TypeMismatch {
expected: &'static str,
actual: &'static str,
},
UnsupportedOperation {
operation: &'static str,
},
}Expand description
Error returned by event bus configuration, publishing, or subscription work.
Variants§
NotStarted
Operation requires a started event bus.
StartFailed
The event bus could not be started.
InvalidArgument
An argument value is invalid.
MissingField
A required builder field is missing.
HandlerFailed
Subscriber handler failed.
HandlerPanicked
Subscriber handler or interceptor panicked.
InterceptorFailed
A configured interceptor failed while processing an event.
ErrorHandlerFailed
A configured error handler failed while processing another error.
DeadLetterFailed
Dead-letter routing failed after a terminal subscriber failure.
ExecutionRejected
Managed executor rejected event processing work.
ShutdownTimedOut
Graceful shutdown did not complete before the configured timeout.
LockPoisoned
Shared state lock was poisoned.
TypeMismatch
A type-erased event or handler had an unexpected payload type.
UnsupportedOperation
Operation is not supported by this backend.
Implementations§
Source§impl EventBusError
impl EventBusError
Sourcepub const fn not_started() -> Self
pub const fn not_started() -> Self
Sourcepub fn start_failed(message: impl Into<String>) -> Self
pub fn start_failed(message: impl Into<String>) -> Self
Creates EventBusError::StartFailed.
§Parameters
message: Startup failure details.
§Returns
Startup error with context.
Sourcepub fn invalid_argument(field: &'static str, message: impl Into<String>) -> Self
pub fn invalid_argument(field: &'static str, message: impl Into<String>) -> Self
Creates EventBusError::InvalidArgument.
§Parameters
field: Argument name.message: Validation message.
§Returns
Validation error with field context.
Sourcepub const fn missing_field(field: &'static str) -> Self
pub const fn missing_field(field: &'static str) -> Self
Creates EventBusError::MissingField.
§Parameters
field: Missing builder field.
§Returns
Builder validation error.
Sourcepub fn handler_failed(message: impl Into<String>) -> Self
pub fn handler_failed(message: impl Into<String>) -> Self
Creates EventBusError::HandlerFailed.
§Parameters
message: Handler failure description.
§Returns
Handler failure error.
Sourcepub const fn handler_panicked() -> Self
pub const fn handler_panicked() -> Self
Creates EventBusError::HandlerPanicked.
§Returns
Handler panic error used by subscriber failure handling.
Sourcepub fn interceptor_failed(
phase: &'static str,
message: impl Into<String>,
) -> Self
pub fn interceptor_failed( phase: &'static str, message: impl Into<String>, ) -> Self
Creates EventBusError::InterceptorFailed.
§Parameters
phase: Interceptor phase.message: Interceptor failure details.
§Returns
Interceptor failure with context.
Sourcepub fn error_handler_failed(
phase: &'static str,
message: impl Into<String>,
) -> Self
pub fn error_handler_failed( phase: &'static str, message: impl Into<String>, ) -> Self
Creates EventBusError::ErrorHandlerFailed.
§Parameters
phase: Error handling phase.message: Handler failure details.
§Returns
Error handler failure with context.
Sourcepub fn dead_letter_failed(message: impl Into<String>) -> Self
pub fn dead_letter_failed(message: impl Into<String>) -> Self
Creates EventBusError::DeadLetterFailed.
§Parameters
message: Dead-letter routing failure details.
§Returns
Dead-letter failure with context.
Sourcepub fn execution_rejected(message: impl Into<String>) -> Self
pub fn execution_rejected(message: impl Into<String>) -> Self
Creates EventBusError::ExecutionRejected.
§Parameters
message: Executor rejection details.
§Returns
Rejection error with executor context.
Sourcepub const fn shutdown_timed_out(timeout: Duration) -> Self
pub const fn shutdown_timed_out(timeout: Duration) -> Self
Creates EventBusError::ShutdownTimedOut.
§Parameters
timeout: Timeout that elapsed before shutdown completed.
§Returns
Shutdown timeout error with the configured duration.
Sourcepub const fn lock_poisoned(resource: &'static str) -> Self
pub const fn lock_poisoned(resource: &'static str) -> Self
Creates EventBusError::LockPoisoned.
§Parameters
resource: Name of the poisoned shared state.
§Returns
Lock-poisoning error.
Sourcepub const fn type_mismatch(expected: &'static str, actual: &'static str) -> Self
pub const fn type_mismatch(expected: &'static str, actual: &'static str) -> Self
Creates EventBusError::TypeMismatch.
§Parameters
expected: Expected type name.actual: Actual type name.
§Returns
Type-erasure mismatch error.
Sourcepub const fn unsupported_operation(operation: &'static str) -> Self
pub const fn unsupported_operation(operation: &'static str) -> Self
Creates EventBusError::UnsupportedOperation.
§Parameters
operation: Operation name or feature category.
§Returns
Error indicating that the current backend does not support the operation.
Trait Implementations§
Source§impl Clone for EventBusError
impl Clone for EventBusError
Source§fn clone(&self) -> EventBusError
fn clone(&self) -> EventBusError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EventBusError
impl Debug for EventBusError
Source§impl Display for EventBusError
impl Display for EventBusError
Source§impl Error for EventBusError
impl Error for EventBusError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for EventBusError
impl PartialEq for EventBusError
Source§fn eq(&self, other: &EventBusError) -> bool
fn eq(&self, other: &EventBusError) -> bool
self and other values to be equal, and is used by ==.