Exception: UberTask::RetryTask

Inherits:
Exception
  • Object
show all
Defined in:
lib/uber_task/retry_task.rb

Overview

We are inheriting from Exception to make sure it won’t be caught by accident which would affect the flow the tasks.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason: nil, wait: 0) ⇒ RetryTask

Returns a new instance of RetryTask.



10
11
12
13
14
15
16
# File 'lib/uber_task/retry_task.rb', line 10

def initialize(reason: nil, wait: 0)
  validate_wait_value!(wait)

  super('Requested to retry the task.')
  @reason = reason
  @wait = wait
end

Instance Attribute Details

#reasonObject

rubocop:disable Lint/InheritException



7
8
9
# File 'lib/uber_task/retry_task.rb', line 7

def reason
  @reason
end

#waitObject

rubocop:disable Lint/InheritException



7
8
9
# File 'lib/uber_task/retry_task.rb', line 7

def wait
  @wait
end