pub enum AdapterError {
Transient(String),
Fatal(String),
Backpressure,
Connection(String),
Shutdown,
Serialization(Error),
}Expand description
Errors that can occur in adapter operations.
Variants§
Transient(String)
Transient error - operation can be retried.
Fatal(String)
Fatal error - adapter is in an unrecoverable state.
Backpressure
Backend cannot accept more data - apply backpressure.
Connection(String)
Connection error.
Shutdown
The adapter has been shut down. Distinct from Connection
so callers (and the bus’s retry classifier) can tell a “we
asked this adapter to stop” reject from a transport failure;
pre-fix every post-shutdown on_batch returned Connection,
which classified as non-retryable and silently dropped the
batch instead of either re-routing or surfacing the shutdown
as a distinct state to the caller.
Serialization(Error)
Serialization/deserialization error. Wraps the underlying
serde_json::Error so callers can read the category, line, and
column via source().
Implementations§
Source§impl AdapterError
impl AdapterError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns true if this error is retryable.
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Returns true if this error means the adapter has been shut
down. Callers can react to this without scraping the
Connection message string.
Trait Implementations§
Source§impl Debug for AdapterError
impl Debug for AdapterError
Source§impl Display for AdapterError
impl Display for AdapterError
Source§impl Error for AdapterError
impl Error for AdapterError
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()