Exception: DianPing::Error::ClientError
- Inherits:
-
DianPing::Error
- Object
- StandardError
- DianPing::Error
- DianPing::Error::ClientError
- Defined in:
- lib/dianping/error/client_error.rb
Overview
Raise when DianPing returns a 4xx HTTP status code or there’s an error in Httparty
Direct Known Subclasses
Class Method Summary collapse
-
.from_response(response = {}) ⇒ DianPing::Error
Create a new error from an HTTP environment.
Methods inherited from DianPing::Error
#backtrace, descendants, errors, #initialize
Constructor Details
This class inherits a constructor from DianPing::Error
Class Method Details
.from_response(response = {}) ⇒ DianPing::Error
Create a new error from an HTTP environment
11 12 13 |
# File 'lib/dianping/error/client_error.rb', line 11 def self.from_response(response={}) new(parse_error(response[:body]), response[:response_headers]) end |