Exception: GmoPayment::Errors::ResponseHasErrCodeError
- Inherits:
-
GmoPayment::Errors
- Object
- StandardError
- GmoPayment::Errors
- GmoPayment::Errors::ResponseHasErrCodeError
- Defined in:
- lib/gmo_payment/errors.rb
Overview
Error of response body has “ErrCode”.
Instance Attribute Summary collapse
Instance Method Summary collapse
- #error_messages(file = nil) ⇒ Hash
-
#initialize(called_method = nil, response = nil) ⇒ ResponseHasErrCodeError
constructor
A new instance of ResponseHasErrCodeError.
Constructor Details
#initialize(called_method = nil, response = nil) ⇒ ResponseHasErrCodeError
Returns a new instance of ResponseHasErrCodeError.
77 78 79 80 81 |
# File 'lib/gmo_payment/errors.rb', line 77 def initialize(called_method = nil, response = nil) self.called_method = called_method self.response = response super("HTTP response called from `#{called_method}' has ErrCode") end |
Instance Attribute Details
#called_method ⇒ Object
73 74 75 |
# File 'lib/gmo_payment/errors.rb', line 73 def called_method @called_method end |
#response ⇒ Object
73 |
# File 'lib/gmo_payment/errors.rb', line 73 attr_accessor :called_method, :response |
Instance Method Details
#error_messages(file = nil) ⇒ Hash
85 86 87 88 89 90 91 |
# File 'lib/gmo_payment/errors.rb', line 85 def (file = nil) require 'yaml' error_list = YAML.load_file(file || GmoPayment::Configure.error_list) self.response.err_info.each_with_object({}) do |error, hash| hash[error] = error_list[error] end end |