Exception: TestingBot::Error
- Inherits:
-
StandardError
- Object
- StandardError
- TestingBot::Error
- Defined in:
- lib/testingbot/errors.rb
Overview
Base class for every error raised by this gem. Rescue TestingBot::Error to catch any failure originating from the client.
Instances carry the HTTP status (when the failure came from an HTTP response) and the raw response body for diagnostics.
Direct Known Subclasses
ApiError, ClientError, ConnectionError, ParseError, ServerError
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
Instance Method Summary collapse
-
#initialize(message = nil, http_status: nil, body: nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message = nil, http_status: nil, body: nil) ⇒ Error
Returns a new instance of Error.
10 11 12 13 14 |
# File 'lib/testingbot/errors.rb', line 10 def initialize( = nil, http_status: nil, body: nil) @http_status = http_status @body = body super() end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
8 9 10 |
# File 'lib/testingbot/errors.rb', line 8 def body @body end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
8 9 10 |
# File 'lib/testingbot/errors.rb', line 8 def http_status @http_status end |