Exception: VerifIP::VerifIPError
- Inherits:
-
StandardError
- Object
- StandardError
- VerifIP::VerifIPError
- Defined in:
- lib/verifip/errors.rb
Overview
Base error class for all VerifIP API errors.
Direct Known Subclasses
AuthenticationError, InvalidRequestError, RateLimitError, ServerError
Instance Attribute Summary collapse
-
#error_code ⇒ String
readonly
Machine-readable error code from the API.
-
#retry_after ⇒ Integer?
readonly
Suggested seconds to wait before retrying.
-
#status_code ⇒ Integer
readonly
HTTP status code (0 for connection errors).
Instance Method Summary collapse
-
#initialize(message = nil, status_code: 0, error_code: "", retry_after: nil) ⇒ VerifIPError
constructor
A new instance of VerifIPError.
- #to_s ⇒ Object
Constructor Details
#initialize(message = nil, status_code: 0, error_code: "", retry_after: nil) ⇒ VerifIPError
Returns a new instance of VerifIPError.
15 16 17 18 19 20 |
# File 'lib/verifip/errors.rb', line 15 def initialize( = nil, status_code: 0, error_code: "", retry_after: nil) super() @status_code = status_code @error_code = error_code || "" @retry_after = retry_after end |
Instance Attribute Details
#error_code ⇒ String (readonly)
Returns machine-readable error code from the API.
10 11 12 |
# File 'lib/verifip/errors.rb', line 10 def error_code @error_code end |
#retry_after ⇒ Integer? (readonly)
Returns suggested seconds to wait before retrying.
13 14 15 |
# File 'lib/verifip/errors.rb', line 13 def retry_after @retry_after end |
#status_code ⇒ Integer (readonly)
Returns HTTP status code (0 for connection errors).
7 8 9 |
# File 'lib/verifip/errors.rb', line 7 def status_code @status_code end |
Instance Method Details
#to_s ⇒ Object
22 23 24 |
# File 'lib/verifip/errors.rb', line 22 def to_s "#{self.class.name}(#{status_code}, '#{error_code}', '#{}')" end |