Exception: ApRubySdk::ApError
- Inherits:
-
StandardError
- Object
- StandardError
- ApRubySdk::ApError
- Defined in:
- lib/ap_ruby_sdk/errors/ap_error.rb
Direct Known Subclasses
APIError, AuthenticationError, InvalidParameterError, PaymentError
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(message = nil, http_status = nil, error_code = nil) ⇒ ApError
constructor
A new instance of ApError.
- #to_s ⇒ Object
Constructor Details
#initialize(message = nil, http_status = nil, error_code = nil) ⇒ ApError
Returns a new instance of ApError.
7 8 9 10 11 |
# File 'lib/ap_ruby_sdk/errors/ap_error.rb', line 7 def initialize(=nil, http_status=nil, error_code=nil) @message = @http_status = http_status @error_code = error_code end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
5 6 7 |
# File 'lib/ap_ruby_sdk/errors/ap_error.rb', line 5 def error_code @error_code end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
4 5 6 |
# File 'lib/ap_ruby_sdk/errors/ap_error.rb', line 4 def http_status @http_status end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/ap_ruby_sdk/errors/ap_error.rb', line 3 def @message end |
Instance Method Details
#to_s ⇒ Object
13 14 15 16 17 |
# File 'lib/ap_ruby_sdk/errors/ap_error.rb', line 13 def to_s status_string = @http_status.nil? ? '' : "(Status #{@http_status})" error_code = @error_code.nil? ? '' : "Error code #{@error_code}" "#{status_string}\n#{@message}\n#{error_code}" end |