Class: Klarna::API::Errors::KlarnaServiceError
- Inherits:
-
XMLRPC::FaultException
- Object
- XMLRPC::FaultException
- Klarna::API::Errors::KlarnaServiceError
- Defined in:
- lib/klarna/api/errors.rb
Instance Method Summary collapse
-
#initialize(error_code, error_key) ⇒ KlarnaServiceError
constructor
A new instance of KlarnaServiceError.
- #to_h ⇒ Object
Constructor Details
#initialize(error_code, error_key) ⇒ KlarnaServiceError
Returns a new instance of KlarnaServiceError.
128 129 130 131 132 133 |
# File 'lib/klarna/api/errors.rb', line 128 def initialize(error_code, error_key) = ::Klarna::API::Errors.(error_key) = ::Klarna.mode == :test ? "#{error_key} (#{[error_code, ERROR_CODES[error_code]].compact.join(' - ')})" : ::Klarna.log , :error super(error_code, ) end |
Instance Method Details
#to_h ⇒ Object
135 136 137 |
# File 'lib/klarna/api/errors.rb', line 135 def to_h {:error_code => self.error_code, :error_message => self.} end |