Exception: ForemanTasks::TaskError
- Inherits:
-
StandardError
- Object
- StandardError
- ForemanTasks::TaskError
- Defined in:
- lib/foreman_tasks/task_error.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#task ⇒ Object
readonly
Returns the value of attribute task.
Instance Method Summary collapse
- #aggregated_message ⇒ Object
-
#initialize(task) ⇒ TaskError
constructor
A new instance of TaskError.
Constructor Details
#initialize(task) ⇒ TaskError
Returns a new instance of TaskError.
6 7 8 9 10 |
# File 'lib/foreman_tasks/task_error.rb', line 6 def initialize(task) @task = task @errors = task.execution_plan.steps.values.map(&:error).compact super() end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
4 5 6 |
# File 'lib/foreman_tasks/task_error.rb', line 4 def errors @errors end |
#task ⇒ Object (readonly)
Returns the value of attribute task.
3 4 5 |
# File 'lib/foreman_tasks/task_error.rb', line 3 def task @task end |
Instance Method Details
#aggregated_message ⇒ Object
12 13 14 15 |
# File 'lib/foreman_tasks/task_error.rb', line 12 def "Task #{task.id}: " + errors.map { |e| "#{e.exception_class}: #{e.}" }.join('; ') end |