Exception: Prest::RequestError

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

Overview

Error for when a request is unsuccessful.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, body: '', headers: {}) ⇒ RequestError

Returns a new instance of RequestError.



16
17
18
19
20
21
# File 'lib/prest.rb', line 16

def initialize(status:, body: '', headers: {})
  super()
  @status = status
  @body = body
  @headers = headers
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



14
15
16
# File 'lib/prest.rb', line 14

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



14
15
16
# File 'lib/prest.rb', line 14

def headers
  @headers
end

#statusObject (readonly)

Returns the value of attribute status.



14
15
16
# File 'lib/prest.rb', line 14

def status
  @status
end