Class: Middleware::Authentication
- Inherits:
-
Restforce::Middleware
- Object
- Restforce::Middleware
- Middleware::Authentication
- Defined in:
- lib/restforce/extensions.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#error_message(response) ⇒ Object
Internal: Get an error message for the passed response.
Instance Method Details
#error_message(response) ⇒ Object
Internal: Get an error message for the passed response. Overrides the default behavior of the middleware to correctly handle broken responses from Faraday.
Returns a String.
11 12 13 14 15 16 17 |
# File 'lib/restforce/extensions.rb', line 11 def (response) if response.status == 0 "Request was closed prematurely" else "#{response.body['error']}: #{response.body['error_description']}" end end |