Exception: Taski::TaskError
- Inherits:
-
StandardError
- Object
- StandardError
- Taski::TaskError
- Extended by:
- AggregateAware
- Defined in:
- lib/taski.rb
Overview
Base class for task-specific error wrappers. Each Task subclass automatically gets a ::Error class that inherits from this. This allows rescuing errors by task class: rescue MyTask::Error => e
Instance Attribute Summary collapse
-
#cause ⇒ Exception
readonly
The original error that occurred in the task.
-
#task_class ⇒ Class
readonly
The task class where the error occurred.
Instance Method Summary collapse
-
#initialize(cause, task_class:) ⇒ TaskError
constructor
A new instance of TaskError.
Methods included from AggregateAware
Constructor Details
#initialize(cause, task_class:) ⇒ TaskError
Returns a new instance of TaskError.
112 113 114 115 116 117 |
# File 'lib/taski.rb', line 112 def initialize(cause, task_class:) @cause = cause @task_class = task_class super(cause.) set_backtrace(cause.backtrace) end |
Instance Attribute Details
#cause ⇒ Exception (readonly)
Returns The original error that occurred in the task.
105 106 107 |
# File 'lib/taski.rb', line 105 def cause @cause end |
#task_class ⇒ Class (readonly)
Returns The task class where the error occurred.
108 109 110 |
# File 'lib/taski.rb', line 108 def task_class @task_class end |