Exception: VehiclesDB::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/vehiclesdb/error.rb

Overview

Any other non-success API response. Carries the HTTP status and parsed body.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, status: nil, body: nil) ⇒ ApiError

Returns a new instance of ApiError.



18
19
20
21
22
# File 'lib/vehiclesdb/error.rb', line 18

def initialize(message = nil, status: nil, body: nil)
  @status = status
  @body = body
  super(message)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



16
17
18
# File 'lib/vehiclesdb/error.rb', line 16

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



16
17
18
# File 'lib/vehiclesdb/error.rb', line 16

def status
  @status
end