21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/eezee/client/requester.rb', line 21
def eezee_client_request(options, method)
request = build_final_request(options, method)
build_faraday_client(request)
.then { |client| build_faraday_request(request, client, method) }
.then { |response| Eezee::Response.new(response) }
.tap { |response| response.log if request.logger }
.tap { |response| request.after!(request, response, nil) }
rescue Faraday::Error => e
response = Eezee::Response.new(e)
error = Eezee::RequestErrorFactory.build(response)
error.log if request.logger
return response if rescue_faraday_error?(request, response, error)
raise error
end
|