Exception: TestingBot::Error

Inherits:
StandardError
  • Object
show all
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.

Instance Attribute Summary collapse

Instance Method Summary collapse

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(message = nil, http_status: nil, body: nil)
  @http_status = http_status
  @body = body
  super(message)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



8
9
10
# File 'lib/testingbot/errors.rb', line 8

def body
  @body
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



8
9
10
# File 'lib/testingbot/errors.rb', line 8

def http_status
  @http_status
end