Exception: Katello::Errors::PulpError

Inherits:
StandardError
  • Object
show all
Defined in:
app/lib/katello/errors.rb

Class Method Summary collapse

Class Method Details

.from_task(task) ⇒ Object



115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'app/lib/katello/errors.rb', line 115

def self.from_task(task)
  if %w(error canceled).include?(task[:state])
    message = if task[:exception]
                Array(task[:exception]).join('; ')
              elsif task[:error]
                "#{task[:error][:code]}: #{task[:error][:description]}"
              elsif task[:state] == 'canceled'
                _("Task canceled")
              else
                _("Pulp task error")
              end
    self.new(message)
  end
end