Exception: Polar::HTTPError

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

Overview

HTTP error base class

Instance Attribute Summary

Attributes inherited from Error

#body, #headers, #status_code

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ HTTPError

Returns a new instance of HTTPError.



18
19
20
21
22
23
24
25
# File 'lib/polar/errors.rb', line 18

def initialize(response)
  @status_code = response.status
  @headers = response.headers
  @body = response.body

  message = parse_error_message(response)
  super(message, status_code: @status_code, headers: @headers, body: @body)
end