Method: BOSSMan::REST.parse_error

Defined in:
lib/bossman/rest.rb

.parse_error(response_string) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/bossman/rest.rb', line 22

def self.parse_error(response_string)
  response_document = REXML::Document.new(response_string)
  error_code = REXML::XPath.first(response_document, '//yahoo:code').text
  error_description = REXML::XPath.first(response_document, '//yahoo:description').text
  error_detail = REXML::XPath.first(response_document, '//yahoo:detail').text
  return "#{error_code} #{error_description}: #{error_detail}"
end