Class: PeopleDoc::ResponseHandlers::V1::HandleBadRequest
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- PeopleDoc::ResponseHandlers::V1::HandleBadRequest
- Defined in:
- lib/people_doc/response_handlers.rb
Defined Under Namespace
Classes: ErrorsResponse, MessageResponse
Instance Method Summary collapse
Methods inherited from BaseHandler
Constructor Details
This class inherits a constructor from PeopleDoc::ResponseHandlers::BaseHandler
Instance Method Details
#call ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/people_doc/response_handlers.rb', line 59 def call return unless @httparty.code == 400 = if @httparty.parsed_response['errors'] ErrorsResponse.new(@httparty).call elsif @httparty.parsed_response['message'] MessageResponse.new(@httparty).call else @httparty.body end fail BadRequest.new(, @httparty.parsed_response) end |