#[non_exhaustive]pub enum TaskError {
ExecutionFailed(String),
#[non_exhaustive] Timeout {
timeout: Duration,
},
Canceled,
HeartbeatFailed(String),
#[non_exhaustive] HeartbeatTimeout {
timeout: Duration,
},
#[non_exhaustive] NotFound {
task_id: String,
},
#[non_exhaustive] AlreadyCompleted {
task_id: String,
},
Panic(String),
#[non_exhaustive] RetryLimitExceeded {
attempts: u32,
},
InvalidInput(String),
InvalidConfiguration(String),
#[non_exhaustive] Application {
error_type: String,
message: String,
non_retryable: bool,
},
}Expand description
Errors that can occur during task execution.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ExecutionFailed(String)
Task execution failed
#[non_exhaustive]Timeout
Task timed out
Fields
This variant is marked as non-exhaustive
Canceled
Task was canceled
HeartbeatFailed(String)
Heartbeat failed
#[non_exhaustive]HeartbeatTimeout
Heartbeat timeout (no heartbeat received)
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]NotFound
Task not found
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]AlreadyCompleted
Task already completed
Fields
This variant is marked as non-exhaustive
Panic(String)
Task panic
#[non_exhaustive]RetryLimitExceeded
Retry limit exceeded
Fields
This variant is marked as non-exhaustive
InvalidInput(String)
Invalid task input
InvalidConfiguration(String)
Invalid task configuration
#[non_exhaustive]Application
A failure the task’s own code names, reported to the engine under
error_type so a retry policy’s non-retryable list can match it.
Build one with TaskError::application or
TaskError::non_retryable.
Fields
This variant is marked as non-exhaustive
Implementations§
Source§impl TaskError
impl TaskError
Sourcepub fn execution_failed(reason: impl Into<String>) -> Self
pub fn execution_failed(reason: impl Into<String>) -> Self
Create an execution failed error
Sourcepub fn heartbeat_failed(reason: impl Into<String>) -> Self
pub fn heartbeat_failed(reason: impl Into<String>) -> Self
Create a heartbeat failed error
Sourcepub fn retry_limit_exceeded(attempts: u32) -> Self
pub fn retry_limit_exceeded(attempts: u32) -> Self
Create a retry limit exceeded error
Sourcepub fn heartbeat_timeout(timeout: Duration) -> Self
pub fn heartbeat_timeout(timeout: Duration) -> Self
Create a heartbeat timeout error
Sourcepub fn already_completed(task_id: impl Into<String>) -> Self
pub fn already_completed(task_id: impl Into<String>) -> Self
Create a task already completed error
Sourcepub fn invalid_input(reason: impl Into<String>) -> Self
pub fn invalid_input(reason: impl Into<String>) -> Self
Create an invalid input error
Sourcepub fn application(
error_type: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn application( error_type: impl Into<String>, message: impl Into<String>, ) -> Self
A failure of type error_type, retried unless the task’s retry policy
lists that type as non-retryable.
Sourcepub fn non_retryable(
error_type: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn non_retryable( error_type: impl Into<String>, message: impl Into<String>, ) -> Self
A failure of type error_type that is never retried, whatever the
task’s retry policy allows.
Returned by workflow code, it fails the workflow the same way: the workflow is not retried, whatever its retry policy allows. Any other error a workflow returns is retried as its policy says.
Trait Implementations§
Source§impl Error for TaskError
impl Error for TaskError
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 Forget for TaskError
impl Freeze for TaskError
impl Move for TaskError
impl RefUnwindSafe for TaskError
impl Send for TaskError
impl Sync for TaskError
impl Unpin for TaskError
impl UnsafeUnpin for TaskError
impl UnwindSafe for TaskError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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