Sha256: 0ee4dd953d51ddc2cc31fd03d86f83b813ebe143af34650250daf381d5df5a0d

Contents?: true

Size: 408 Bytes

Versions: 61

Compression:

Stored size: 408 Bytes

Contents

module ForemanTasks
  class TaskError < StandardError

    attr_reader :task
    attr_reader :errors

    def initialize(task)
      @task = task
      @errors = task.execution_plan.steps.values.map(&:error).compact
      super(aggregated_message)
    end

    def aggregated_message
      "Task #{task.id}: " +
          errors.map { |e| "#{e.exception_class}: #{e.message}" }.join('; ')
    end

  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
foreman-tasks-0.8.6 lib/foreman_tasks/task_error.rb
foreman-tasks-0.8.5 lib/foreman_tasks/task_error.rb
foreman-tasks-0.8.4 lib/foreman_tasks/task_error.rb
foreman-tasks-0.8.3 lib/foreman_tasks/task_error.rb
foreman-tasks-0.8.2 lib/foreman_tasks/task_error.rb
foreman-tasks-0.8.1 lib/foreman_tasks/task_error.rb
foreman-tasks-0.8.0 lib/foreman_tasks/task_error.rb
foreman-tasks-0.7.20 lib/foreman_tasks/task_error.rb
foreman-tasks-0.7.19 lib/foreman_tasks/task_error.rb
foreman-tasks-0.7.18 lib/foreman_tasks/task_error.rb
foreman-tasks-0.7.17 lib/foreman_tasks/task_error.rb
foreman-tasks-0.7.16 lib/foreman_tasks/task_error.rb
foreman-tasks-0.7.15 lib/foreman_tasks/task_error.rb
foreman-tasks-0.7.14 lib/foreman_tasks/task_error.rb
foreman-tasks-0.7.13 lib/foreman_tasks/task_error.rb
foreman-tasks-0.7.12 lib/foreman_tasks/task_error.rb
foreman-tasks-0.7.11 lib/foreman_tasks/task_error.rb
foreman-tasks-0.7.10 lib/foreman_tasks/task_error.rb
foreman-tasks-0.7.9 lib/foreman_tasks/task_error.rb
foreman-tasks-0.7.8 lib/foreman_tasks/task_error.rb