Class: PeopleDoc::ResponseHandlers::V2::HandleUnauthorized
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- PeopleDoc::ResponseHandlers::V2::HandleUnauthorized
- Defined in:
- lib/people_doc/response_handlers.rb
Instance Method Summary collapse
Methods inherited from BaseHandler
Constructor Details
This class inherits a constructor from PeopleDoc::ResponseHandlers::BaseHandler
Instance Method Details
#call ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/people_doc/response_handlers.rb', line 110 def call return unless @httparty.code == 401 = if @httparty.parsed_response['error'] format( '%<error>s: %<description>s', error: @httparty.parsed_response['error'], description: @httparty .parsed_response['error_description'] ) elsif @httparty.parsed_response['code'] format( '%<code>s: %<message>s', code: @httparty.parsed_response['code'], message: @httparty.parsed_response['message'] ) else @httparty.body end fail Unauthorized.new() end |