Exception: OData::HTTPError

Inherits:
Error
  • Object
show all
Defined in:
lib/odata/errors.rb

Direct Known Subclasses

ClientError, ServerError

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ HTTPError


5
6
7
8
9
10
# File 'lib/odata/errors.rb', line 5

def initialize(response)
  body = JSON.parse(response.body)
  super "#{response.code} #{body['error']['code']}: \"#{body['error']['message']}\" from \"#{response.uri}\""
rescue
  super
end