pub struct ActivityError {
pub exception_type: String,
pub message: String,
pub non_retryable: bool,
}Expand description
An application failure returned by an activity handler.
The exception type is matched by crate::ActivityRetryPolicy::non_retryable_error_types().
Local and remote activities preserve the same type, message and retry marker.
Convert this error into Error with .into() when returning it from a handler.
Fields§
§exception_type: String§message: String§non_retryable: boolImplementations§
Source§impl ActivityError
impl ActivityError
Sourcepub fn new(
exception_type: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn new( exception_type: impl Into<String>, message: impl Into<String>, ) -> Self
Create a retryable application failure with a stable application-defined type.
Sourcepub fn non_retryable(self, non_retryable: bool) -> Self
pub fn non_retryable(self, non_retryable: bool) -> Self
Stop retries regardless of the activity’s retry policy when set to true.
Trait Implementations§
Source§impl Clone for ActivityError
impl Clone for ActivityError
Source§fn clone(&self) -> ActivityError
fn clone(&self) -> ActivityError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ActivityError
impl Debug for ActivityError
Source§impl Display for ActivityError
impl Display for ActivityError
Source§impl Error for ActivityError
impl Error for ActivityError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ActivityError> for Error
impl From<ActivityError> for Error
Source§fn from(source: ActivityError) -> Self
fn from(source: ActivityError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ActivityError
impl PartialEq for ActivityError
impl Eq for ActivityError
impl StructuralPartialEq for ActivityError
Auto Trait Implementations§
impl Freeze for ActivityError
impl RefUnwindSafe for ActivityError
impl Send for ActivityError
impl Sync for ActivityError
impl Unpin for ActivityError
impl UnwindSafe for ActivityError
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
Mutably borrows from an owned value. Read more