Exception: Netflix::Error::ResponseError

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

Direct Known Subclasses

ClientError, ServerError

Instance Method Summary collapse

Constructor Details

#initialize(body, headers) ⇒ ResponseError

Returns a new instance of ResponseError.



6
7
8
9
10
11
12
# File 'lib/netflix/errors.rb', line 6

def initialize(body, headers)
  @body = body
  @headers = headers
  body_obj = JSON.parse(body)
  message = body_obj["status"]["message"]
  super(message)
end