Exception: Temporalio::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/temporalio/error.rb,
lib/temporalio/error/failure.rb

Overview

Superclass for all Temporal errors

Defined Under Namespace

Modules: RetryState Classes: ActivityError, ApplicationError, AsyncActivityCanceledError, CanceledError, ChildWorkflowError, Failure, RPCError, ServerError, TerminatedError, TimeoutError, WorkflowAlreadyStartedError, WorkflowContinuedAsNewError, WorkflowFailedError, WorkflowQueryFailedError, WorkflowQueryRejectedError, WorkflowUpdateFailedError, WorkflowUpdateRPCTimeoutOrCanceledError

Class Method Summary collapse

Class Method Details

.canceled?(error) ⇒ Boolean

Whether the error represents some form of cancellation from an activity or workflow.

Parameters:

  • error (Exception)

    Error to check.

Returns:

  • (Boolean)

    True if some form of canceled, false otherwise.



12
13
14
15
16
# File 'lib/temporalio/error.rb', line 12

def self.canceled?(error)
  error.is_a?(CanceledError) ||
    (error.is_a?(ActivityError) && error.cause.is_a?(CanceledError)) ||
    (error.is_a?(ChildWorkflowError) && error.cause.is_a?(CanceledError))
end