Method: Azure::Core::Http::HTTPError#parse_response

Defined in:
lib/azure/core/http/http_error.rb

#parse_responseObject

Extract the relevant information from the response’s body. If the response body is not an XML, we return an ‘Unknown’ error with the entire body as the description

Returns nothing



85
86
87
88
89
90
91
92
93
94
95
# File 'lib/azure/core/http/http_error.rb', line 85

def parse_response
  if @http_response.body && @http_response.respond_to?(:headers) && @http_response.headers['Content-Type']
    if @http_response.headers['Content-Type'].include?('xml')
      parse_xml_response
    elsif @http_response.headers['Content-Type'].include?('json')
      parse_json_response
    end
  else
    parse_unknown_response
  end
end