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)
-
- (String) description
readonly
Localized error description.
-
- (Hash) params
readonly
Optional error params.
Class Method Summary (collapse)
-
+ (ApiError) from_json(json)
Extracts error arguments from specified json.
Instance Method Summary (collapse)
-
- (ApiError) initialize(code, description, params)
constructor
A new instance of ApiError.
Constructor Details
- (ApiError) initialize(code, description, params)
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
- (String) description (readonly)
Returns Localized error description.
8 9 10 |
# File 'lib/reg_api2/api_error.rb', line 8 def description @description end |
- (Hash) params (readonly)
Returns Optional error params.
11 12 13 |
# File 'lib/reg_api2/api_error.rb', line 11 def params @params end |
Class Method Details
+ (ApiError) from_json(json)
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 |