Exception: Temporalio::Error::ApplicationError

Inherits:
Failure 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

Methods inherited from Temporalio::Error

canceled?

Constructor Details

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

Create an application error.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/temporalio/error/failure.rb', line 60

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

#categoryCategory (readonly)



50
51
52
# File 'lib/temporalio/error/failure.rb', line 50

def category
  @category
end

#detailsArray<Object, nil> (readonly)



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

def details
  @details
end

#next_retry_delayFloat? (readonly)



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.



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

def non_retryable
  @non_retryable
end

#typeString? (readonly)



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

def type
  @type
end

Instance Method Details

#retryable?Boolean



77
78
79
# File 'lib/temporalio/error/failure.rb', line 77

def retryable?
  !@non_retryable
end