Exception: Dadata::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/dadata/api_exceptions.rb

Overview

Raised when the API responds with a non-success HTTP status.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, message) ⇒ ApiError

Returns a new instance of ApiError.



13
14
15
16
# File 'lib/dadata/api_exceptions.rb', line 13

def initialize(status, message)
  @status = status
  super("Error: #{status} - #{message}")
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



11
12
13
# File 'lib/dadata/api_exceptions.rb', line 11

def status
  @status
end