Class: Temporalio::Error::ApplicationError

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

Overview

Error raised during workflow/activity execution.

Defined Under Namespace

Modules: Category

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Create an application error.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/temporalio/error/failure.rb', line 80

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

Instance Attribute Details

#category ⇒ Category (readonly)



70
71
72
# File 'lib/temporalio/error/failure.rb', line 70

def category
  @category
end

#details ⇒ Array<Object, nil> (readonly)



55
56
57
# File 'lib/temporalio/error/failure.rb', line 55

def details
  @details
end

#next_retry_delay ⇒ Float? (readonly)



67
68
69
# File 'lib/temporalio/error/failure.rb', line 67

def next_retry_delay
  @next_retry_delay
end

#non_retryable ⇒ Boolean (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.



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

def non_retryable
  @non_retryable
end

#type ⇒ String? (readonly)



58
59
60
# File 'lib/temporalio/error/failure.rb', line 58

def type
  @type
end

Instance Method Details

#retryable? ⇒ Boolean



97
98
99
# File 'lib/temporalio/error/failure.rb', line 97

def retryable?
  !@non_retryable
end