Exception: Dialers::ErrorWithResponse
- Inherits:
-
StandardError
- Object
- StandardError
- Dialers::ErrorWithResponse
- Defined in:
- lib/dialers/errors.rb
Direct Known Subclasses
ImpossibleTranformationError, NotFoundError, ResponseError, ServerError, UnauthorizedError
Instance Method Summary collapse
-
#initialize(response = nil) ⇒ ErrorWithResponse
constructor
A new instance of ErrorWithResponse.
- #message ⇒ Object
Constructor Details
#initialize(response = nil) ⇒ ErrorWithResponse
Returns a new instance of ErrorWithResponse.
17 18 19 |
# File 'lib/dialers/errors.rb', line 17 def initialize(response = nil) self.response = response end |
Instance Method Details
#message ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/dialers/errors.rb', line 21 def if response.nil? super else "\n STATUS: #{response.status} URL: #{response.env.url} REQUEST HEADERS: #{response.env.request_headers} HEADERS: #{response.env.response_headers} BODY: #{response.body}\n\n" end end |