Exception: RegApi2::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- RegApi2::ApiError
- Defined in:
- lib/reg_api2/api_error.rb
Overview
API Error from REG.API provider. Please refer to common error codes.
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
Localized error description.
-
#params ⇒ Hash
readonly
Optional error params.
Class Method Summary collapse
-
.from_json(json) ⇒ ApiError
Extracts error arguments from specified json.
Instance Method Summary collapse
-
#initialize(code, description, params) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(code, description, params) ⇒ ApiError
Returns a new instance of ApiError.
13 14 15 16 17 |
# File 'lib/reg_api2/api_error.rb', line 13 def initialize code, description, params super code @description = description @params = params || {} end |
Instance Attribute Details
#description ⇒ String (readonly)
Returns Localized error description.
8 9 10 |
# File 'lib/reg_api2/api_error.rb', line 8 def description @description end |
#params ⇒ Hash (readonly)
Returns Optional error params.
11 12 13 |
# File 'lib/reg_api2/api_error.rb', line 11 def params @params end |
Class Method Details
.from_json(json) ⇒ ApiError
Extracts error arguments from specified json.
22 23 24 25 26 27 28 |
# File 'lib/reg_api2/api_error.rb', line 22 def self.from_json json new( json['error_code'], json['error_text'], json['error_params'] ) end |