diff --git a/lib/rack_reverse_proxy/roundtrip.rb b/lib/rack_reverse_proxy/roundtrip.rb index 3b10331..789b34c 100644 --- a/lib/rack_reverse_proxy/roundtrip.rb +++ b/lib/rack_reverse_proxy/roundtrip.rb @@ -166,6 +166,9 @@ def rack_response_headers format_headers(target_response.headers) ) ) + rescue Errno::ECONNREFUSED => e + @_target_response = Struct.new(:status, :body).new(502, []) + {} end def replace_location_header