Exception: Magento::ApiError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/magento/api_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, error_code = nil, original_exception = nil) ⇒ ApiError

Returns a new instance of ApiError.



7
8
9
10
11
# File 'lib/magento/api_error.rb', line 7

def initialize(message, error_code = nil, original_exception = nil)
  @message = message
  @error_code = error_code
  @original_exception = original_exception
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



5
6
7
# File 'lib/magento/api_error.rb', line 5

def error_code
  @error_code
end

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/magento/api_error.rb', line 5

def message
  @message
end

#original_exceptionObject (readonly)

Returns the value of attribute original_exception.



5
6
7
# File 'lib/magento/api_error.rb', line 5

def original_exception
  @original_exception
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/magento/api_error.rb', line 13

def to_s
  "#{message} (error code: #{error_code})"
end