Skip to main content

Error

Enum Error 

pub enum Error {
Show 16 variants Busy, NotFound(String), AlreadyExists(String), UnknownWorkflow(String), Step { name: String, failure: Failure, }, Failed(Failure), Child { id: String, failure: Failure, }, Cancelled(String), TimedOut, Terminated, Determinism(String), Rejected(String), Codec(String), Connection(String), Io(String), Closed,
}
Expand description

Everything that can go wrong in Fusee, as seen by application code.

Every SDK has the same set, named by Error::code; each code has a page at Error::docs.

Variants§

§

Busy

The shard’s queues are full. Retry later; nothing was recorded.

§

NotFound(String)

No run with this workflow ID is known (never started, or its retention ended).

§

AlreadyExists(String)

A workflow with this ID already exists and the start asked for a new run only. Carries the ID and what holds it.

§

UnknownWorkflow(String)

No code is registered for this workflow type (or version). Carries the message, which lists the types that are registered.

§

Step

A step failed after its last attempt, or with a failure that is not retried. Carries the step name and the step’s failure.

Fields

§name: String
§failure: Failure
§

Failed(Failure)

The workflow (or an update, or an object’s handler) failed.

§

Child

A child workflow failed. Carries its workflow ID and its failure.

Fields

§failure: Failure
§

Cancelled(String)

Cancellation reached this operation. Carries the reason.

§

TimedOut

A timeout elapsed (step, wait, or the workflow’s deadline).

§

Terminated

The run was terminated.

§

Determinism(String)

The code made different journal operations than its journal records.

§

Rejected(String)

A request was refused and nothing was recorded: an update’s validator refused it, a completion token is stale, an argument is invalid. Carries the reason.

§

Codec(String)

A value could not be serialized or deserialized.

§

Connection(String)

No connection to a Fusee server, or it was lost.

§

Io(String)

A disk or network failure. After a failed flush the shard stops.

§

Closed

The engine is closed.

Implementations§

§

impl Error

pub fn code(&self) -> &'static str

The error’s code, the same in every SDK.

pub fn docs(&self) -> String

A link to the page for this error’s code.

pub fn failed(message: impl Into<String>) -> Self

An error with a failure to wrap: a workflow’s failure from a message.

pub fn failure(&self) -> Option<&Failure>

The failure this error carries, if it carries one.

pub fn is_retryable(&self) -> bool

Whether a step that returned this error may be retried.

pub fn to_failure(&self) -> Failure

The error as a recorded failure. Fusee’s own errors record their code as the type, so every SDK reads them back as the same error.

pub fn from_failure(f: Failure) -> Self

Reads a recorded failure back: one of Fusee’s own errors when its type is one of their codes, otherwise a workflow failure.

Trait Implementations§

§

impl Clone for Error

§

fn clone(&self) -> Error

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Error

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl Display for Error

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl Error for Error

§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
§

impl From<DeterminismError> for Error

§

fn from(e: DeterminismError) -> Self

Converts to this type from the input type.
§

impl From<Error> for Error

§

fn from(e: Error) -> Self

Converts to this type from the input type.
§

impl From<Error> for Error

§

fn from(e: Error) -> Self

Converts to this type from the input type.
§

impl From<Error> for Failure

§

fn from(e: Error) -> Self

Converts to this type from the input type.
§

impl From<Failure> for Error

§

fn from(f: Failure) -> Self

Converts to this type from the input type.
§

impl PartialEq for Error

§

fn eq(&self, other: &Error) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Eq for Error

§

impl StructuralPartialEq for Error

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<E> IntoFailure for E
where E: Display + 'static,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.