Exception: PostalCodesRubyClient::ApiError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of ApiError.



20
21
22
23
24
# File 'lib/postal_codes_ruby_client/errors.rb', line 20

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

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



18
19
20
# File 'lib/postal_codes_ruby_client/errors.rb', line 18

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



18
19
20
# File 'lib/postal_codes_ruby_client/errors.rb', line 18

def status
  @status
end