Exception: VatNumberValidator::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- VatNumberValidator::APIError
- Defined in:
- lib/vat_number_validator/errors.rb
Instance Method Summary collapse
-
#initialize(result) ⇒ APIError
constructor
A new instance of APIError.
Constructor Details
#initialize(result) ⇒ APIError
Returns a new instance of APIError.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/vat_number_validator/errors.rb', line 3 def initialize(result) code = result['error']['code'] = case code when 101 'invalid/missing access_key' when 104 'usage limit reached' when 105 'https access restricted' when 102 'inactive user' else "vatlayer API error code #{code}" end super() end |