Sha256: 942c15607ee923f5996b2e8f8a3ff0bd4bd2dd01ab4983d0e7a6ac37d2fde541

Contents?: true

Size: 404 Bytes

Versions: 129

Compression:

Stored size: 404 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

129 entries across 129 versions & 1 rubygems

Version Path
foreman-tasks-10.0.2 lib/foreman_tasks/task_error.rb
foreman-tasks-10.0.1 lib/foreman_tasks/task_error.rb
foreman-tasks-10.0.0 lib/foreman_tasks/task_error.rb
foreman-tasks-9.2.3 lib/foreman_tasks/task_error.rb
foreman-tasks-9.2.2 lib/foreman_tasks/task_error.rb
foreman-tasks-9.2.1 lib/foreman_tasks/task_error.rb
foreman-tasks-9.2.0 lib/foreman_tasks/task_error.rb
foreman-tasks-9.1.1 lib/foreman_tasks/task_error.rb
foreman-tasks-9.0.4 lib/foreman_tasks/task_error.rb
foreman-tasks-9.1.0 lib/foreman_tasks/task_error.rb
foreman-tasks-9.0.2 lib/foreman_tasks/task_error.rb
foreman-tasks-9.0.1 lib/foreman_tasks/task_error.rb
foreman-tasks-8.3.3 lib/foreman_tasks/task_error.rb
foreman-tasks-9.0.0 lib/foreman_tasks/task_error.rb
foreman-tasks-8.2.1 lib/foreman_tasks/task_error.rb
foreman-tasks-8.1.4 lib/foreman_tasks/task_error.rb
foreman-tasks-8.3.2 lib/foreman_tasks/task_error.rb
foreman-tasks-8.3.1 lib/foreman_tasks/task_error.rb
foreman-tasks-8.1.3 lib/foreman_tasks/task_error.rb
foreman-tasks-8.3.0 lib/foreman_tasks/task_error.rb