From 391218c0ee164750202df62bb3bb097ad586ec01 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Mon, 28 Apr 2025 10:08:58 +0200 Subject: [PATCH] Fix unused variable warnings ``` async-http-0.86.0/lib/async/http/protocol/http1/server.rb:55: warning: assigned but unused variable - error async-http-0.86.0/lib/async/http/protocol/http2/connection.rb:99: warning: assigned but unused variable - ignored_error ``` --- lib/async/http/protocol/http1/server.rb | 2 +- lib/async/http/protocol/http2/connection.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/async/http/protocol/http1/server.rb b/lib/async/http/protocol/http1/server.rb index 2ebf1ca..1c0e45f 100644 --- a/lib/async/http/protocol/http1/server.rb +++ b/lib/async/http/protocol/http1/server.rb @@ -52,7 +52,7 @@ def next_request end return request - rescue ::Protocol::HTTP1::BadRequest => error + rescue ::Protocol::HTTP1::BadRequest fail_request(400) # Conceivably we could retry here, but we don't really know how bad the error is, so it's better to just fail: raise diff --git a/lib/async/http/protocol/http2/connection.rb b/lib/async/http/protocol/http2/connection.rb index e2c2876..1e84d23 100644 --- a/lib/async/http/protocol/http2/connection.rb +++ b/lib/async/http/protocol/http2/connection.rb @@ -94,7 +94,7 @@ def read_in_background(parent: Task.current) # Error is raised if a response is actively reading from the # connection. The connection is silently closed if GOAWAY is # received outside the request/response cycle. - rescue SocketError, IOError, EOFError, Errno::ECONNRESET, Errno::EPIPE => ignored_error + rescue SocketError, IOError, EOFError, Errno::ECONNRESET, Errno::EPIPE # Ignore. rescue => error # Every other error.