#[non_exhaustive]pub enum ErrorClass {
Retryable,
Fatal,
Unknown,
}Expand description
The coarse answer to “may I try this call again”: see Error::class.
§Examples
use brokapi_core::{Error, ErrorClass};
assert_eq!(Error::Unknown.class(), ErrorClass::Unknown);
assert_eq!(Error::NotReconciled.class(), ErrorClass::Fatal);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Retryable
The call failed for a reason that can pass: the network, a rate limit. Reading calls may be
repeated, after the delay in Error::RateLimited if there is one. For a command this class is
not a licence to repeat: first find out what the broker has (see Error::Transport), and
ask Error::retryable_for_command in a retry loop of commands.
Fatal
The same call will fail again until something else changes: a setup, a refused request, a missing capability, a gate that is closed. Do not repeat it unchanged.
Unknown
The outcome of a command is not known: Error::Unknown. Repeating the command could create
a second order. The library never repeats it and neither should the caller before it knows
the state of the order.
Trait Implementations§
Source§impl Clone for ErrorClass
impl Clone for ErrorClass
Source§fn clone(&self) -> ErrorClass
fn clone(&self) -> ErrorClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ErrorClass
Source§impl Debug for ErrorClass
impl Debug for ErrorClass
Source§impl<'de> Deserialize<'de> for ErrorClass
impl<'de> Deserialize<'de> for ErrorClass
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ErrorClass
Source§impl PartialEq for ErrorClass
impl PartialEq for ErrorClass
Source§fn eq(&self, other: &ErrorClass) -> bool
fn eq(&self, other: &ErrorClass) -> bool
self and other values to be equal, and is used by ==.