Skip to content

Commit ce9db4e

Browse files
committed
The rescue clause is needed for the local variable error.
Effectively reverts 486074a.
1 parent bb87b1c commit ce9db4e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/async/http/protocol/http1/server.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ def each(task: Task.current)
151151
# Do not remove this line or you will unleash the gods of concurrency hell.
152152
task.yield
153153
end
154+
rescue => error
155+
# We store error (as a local variable) for later use in the ensure block.
156+
raise
154157
ensure
155158
body&.close(error)
156159
end

0 commit comments

Comments
 (0)