Exception: Xendit::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- Xendit::APIError
- Defined in:
- lib/xendit/errors.rb
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
Instance Method Summary collapse
-
#initialize(error_code, error_message, http_status) ⇒ APIError
constructor
A new instance of APIError.
- #to_s ⇒ Object
Constructor Details
#initialize(error_code, error_message, http_status) ⇒ APIError
7 8 9 10 11 12 13 |
# File 'lib/xendit/errors.rb', line 7 def initialize(error_code, , http_status) @error_code = error_code = @http_status = http_status super to_s end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
5 6 7 |
# File 'lib/xendit/errors.rb', line 5 def error_code @error_code end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
5 6 7 |
# File 'lib/xendit/errors.rb', line 5 def end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
5 6 7 |
# File 'lib/xendit/errors.rb', line 5 def http_status @http_status end |
Instance Method Details
#to_s ⇒ Object
15 16 17 18 19 |
# File 'lib/xendit/errors.rb', line 15 def to_s status_string = @http_status.nil? ? '' : "(Status #{@http_status}) " error_code_string = @error_code.nil? ? '' : "#{error_code} - " "#{status_string}#{error_code_string}#{@error_message}" end |