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



91
92
93
94
95
96
97
98
# File 'app/lib/katello/errors.rb', line 91

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