From 5258f8230b658ef233add9f626007ebc811a3463 Mon Sep 17 00:00:00 2001 From: HoneyryderChuck Date: Tue, 7 Apr 2020 01:29:00 +0100 Subject: [PATCH] fixed error being assigned nil --- lib/httpx/connection.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/httpx/connection.rb b/lib/httpx/connection.rb index 422f0663..3a633435 100644 --- a/lib/httpx/connection.rb +++ b/lib/httpx/connection.rb @@ -438,12 +438,12 @@ module HTTPX return unless @timeout <= 0 end - error = if @total_timeout && @total_timeout.fires_in.negative? + if @total_timeout && @total_timeout.fires_in.negative? ex = TotalTimeoutError.new(@total_timeout.interval, "Timed out after #{@total_timeout.interval} seconds") ex.set_backtrace(error.backtrace) - ex + error = ex elsif connecting? - error.to_connection_error + error = error.to_connection_error end end