Exception: DianPing::Error::ClientError

Inherits:
DianPing::Error show all
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

NotFound

Class Method Summary collapse

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

Parameters:

  • response (Hash) (defaults to: {})

Returns:



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