Exception: Temporalio::Error::ApplicationError

Inherits:
Failure show all
Defined in:
lib/temporalio/error/failure.rb

Overview

Error raised during workflow/activity execution.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Temporalio::Error

canceled?

Constructor Details

#initialize(message, *details, type: nil, non_retryable: false, next_retry_delay: nil) ⇒ ApplicationError

Create an application error.

Parameters:

  • message (String)

    Error message.

  • details (Array<Object, nil>)

    Error details.

  • type (String, nil) (defaults to: nil)

    Error type.

  • non_retryable (Boolean) (defaults to: false)

    Whether this error should be considered non-retryable.

  • next_retry_delay (Float, nil) (defaults to: nil)

    Specific amount of time to delay before next retry.



56
57
58
59
60
61
62
# File 'lib/temporalio/error/failure.rb', line 56

def initialize(message, *details, type: nil, non_retryable: false, next_retry_delay: nil)
  super(message)
  @details = details
  @type = type
  @non_retryable = non_retryable
  @next_retry_delay = next_retry_delay
end

Instance Attribute Details

#detailsArray<Object, nil> (readonly)

Returns User-defined details on the error.

Returns:

  • (Array<Object, nil>)

    User-defined details on the error.



35
36
37
# File 'lib/temporalio/error/failure.rb', line 35

def details
  @details
end

#next_retry_delayFloat? (readonly)

Returns Delay in seconds before the next activity retry attempt.

Returns:

  • (Float, nil)

    Delay in seconds before the next activity retry attempt.



47
48
49
# File 'lib/temporalio/error/failure.rb', line 47

def next_retry_delay
  @next_retry_delay
end

#non_retryableBoolean (readonly)

Note:

This is not whether the error is non-retryable via other means such as retry policy. This is just

whether the error was marked non-retryable upon creation by the user.

Returns:

  • (Boolean)

    Whether the error was set as non-retryable when created.



44
45
46
# File 'lib/temporalio/error/failure.rb', line 44

def non_retryable
  @non_retryable
end

#typeString? (readonly)

Returns General error type.

Returns:

  • (String, nil)

    General error type.



38
39
40
# File 'lib/temporalio/error/failure.rb', line 38

def type
  @type
end

Instance Method Details

#retryable?Boolean

Returns Inverse of #non_retryable.

Returns:



65
66
67
# File 'lib/temporalio/error/failure.rb', line 65

def retryable?
  !@non_retryable
end