pub enum Error {
Rejected(Rejected),
NotSettled(Vec<StoredEvent>),
NotDue(String),
Status(Status),
Config(String),
Json(Error),
Store(Error),
}Expand description
Why a call to the kernel failed. It implements std::error::Error, so ? turns it into a
BoxError in handlers and main.
Variants§
Rejected(Rejected)
A rejection: the read model or a middleware refused the query
(crate::Kernable::query), or a command handler refused the command in
crate::Aggregate::handle. A rejected submit is not an error but
crate::Outcome::Rejected.
NotSettled(Vec<StoredEvent>)
The command was committed, but not every listener that counts processed its events
within the kernel’s --settle-timeout-ms. Read models may not show the change yet; the
committed events are attached. Submitting again with the same ID returns the same
outcome.
NotDue(String)
The command with this ID is scheduled (crate::Submit::at) and not due yet: it has no
outcome to wait for. Submit it again by its ID after its time.
Status(Status)
The kernel refused the call or could not be reached: the gRPC status, e.g.
PERMISSION_DENIED without a grant (see Errors in the reference).
Config(String)
A key, grant or certificate could not be read, or an option is invalid; also a failing
handler in crate::Aggregate::fold and crate::Aggregate::handle.
Json(Error)
Data could not be encoded or decoded as JSON.
Store(Error)
A read model’s store failed.
Implementations§
Source§impl Error
impl Error
Sourcepub fn waits_for_switch(&self) -> bool
pub fn waits_for_switch(&self) -> bool
Whether the kernel refused a membership because it would switch its service to a
deployment that has not caught up yet (not_caught_up), back to one that served before
while crate::Switch::CaughtUp (served_before), or at all while
crate::Switch::Never (not_serving): applying it again may succeed later, once
the deployment caught up or an operator switched to it.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Forget for Error
impl Freeze for Errorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const Requirement is !null: Freeze,
PhantomData<Requirement>: Freeze,
PhantomData<StoredEvent>: Freeze,
*const StatusInner is !null: Freeze,
PhantomData<StatusInner>: Freeze,
*const ErrorImpl is !null: Freeze,
PhantomData<ErrorImpl>: Freeze,
*const dyn Error + Sync + Send is !null: Freeze,
PhantomData<dyn Error + Sync + Send>: Freeze,
impl Move for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Errorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const Requirement is !null: UnsafeUnpin,
PhantomData<Requirement>: UnsafeUnpin,
PhantomData<StoredEvent>: UnsafeUnpin,
*const StatusInner is !null: UnsafeUnpin,
PhantomData<StatusInner>: UnsafeUnpin,
*const ErrorImpl is !null: UnsafeUnpin,
PhantomData<ErrorImpl>: UnsafeUnpin,
*const dyn Error + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn Error + Sync + Send>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request