Skip to main content

Error

Struct Error 

Source
pub struct Error { /* private fields */ }
Expand description

Why a run, a compile or a function failed.

Implementations§

Source§

impl Error

Source

pub fn service( code: impl Into<Cow<'static, str>>, message: impl Into<Cow<'static, str>>, ) -> Self

An error carrying a function’s own code.

Source

pub fn budget(message: impl Into<Cow<'static, str>>) -> Self

An error indicating an operation, task, or custom run budget was exceeded.

Source

pub fn kind(&self) -> &ErrorKind

The class of the error.

Source

pub fn message(&self) -> &str

The human-readable message.

Source

pub fn with_retryable(self, yes: bool) -> Self

Overrides whether a retry may succeed.

Source

pub fn with_source(self, source: impl Error + Send + Sync + 'static) -> Self

Attaches the error that caused this one.

Source

pub fn datalogic_error(&self) -> Option<&Error>

The underlying datalogic_rs::Error, when this error came from expression compilation or evaluation.

Source

pub fn with_expr_cause(self, cause: ExprCause) -> Self

Attaches structured expression diagnostics to this error.

Source

pub fn expr_cause(&self) -> Option<&ExprCause>

Structured expression diagnostics, when this error came from an expression or a budget check.

Source

pub fn with_site(self, site: ErrorSite) -> Self

Attaches the workflow site where this error happened.

Source

pub fn site(&self) -> Option<&ErrorSite>

Where in the workflow this error happened, when known.

Source

pub fn is_retryable(&self) -> bool

May a retry succeed? A timeout says yes unless told otherwise; everything else says no.

Source

pub fn wrap(self, context: impl Display) -> Self

Prefixes the message with context, keeping kind, retryability, source, structured cause and workflow site.

Source

pub fn code(&self) -> &str

The recorded code for this error.

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Error

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

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
Source§

impl From<&Error> for ErrorRecord

Source§

fn from(error: &Error) -> Self

Converts to this type from the input type.
Source§

impl Serialize for Error

Writes the error as {"code", "message", "retryable"}: Error::code, Error::message and Error::is_retryable, in that order.

Source§

fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin 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.

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.