lib/acfs/adapter/typhoeus.rb in acfs-1.4.0 vs lib/acfs/adapter/typhoeus.rb in acfs-1.5.0
- old
+ new
@@ -53,17 +53,17 @@
}
request = ::Typhoeus::Request.new(req.url, **@opts.merge(opts))
request.on_complete do |response|
- if response.timed_out?
- raise ::Acfs::TimeoutError.new(req)
- elsif response.code.zero?
+ raise ::Acfs::TimeoutError.new(req) if response.timed_out?
+
+ if response.code.zero?
# Failed to get HTTP response
raise ::Acfs::RequestError.new(req, response.return_message)
- else
- req.complete! convert_response(req, response)
end
+
+ req.complete! convert_response(req, response)
end
request
end