Exception: Katello::Errors::CandlepinError

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

Class Method Summary collapse

Class Method Details

.from_exception(exception) ⇒ Object

Return a CandlepinError with the displayMessage as the message set it



97
98
99
100
101
102
103
104
# File 'app/lib/katello/errors.rb', line 97

def self.from_exception(exception)
  error_data = MultiJson.load(exception.response)
  if (display_message = error_data["displayMessage"])
    self.new(display_message).tap { |e| exception.set_backtrace(e.backtrace) }
  end
rescue StandardError
  return nil
end