File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
lib/async/http/protocol/http1 Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 7
7
# Copyright, 2024, by Anton Zhuravsky.
8
8
9
9
require_relative 'connection'
10
+ require 'console/event/failure'
10
11
11
12
module Async
12
13
module HTTP
@@ -17,8 +18,9 @@ def fail_request(status)
17
18
@persistent = false
18
19
write_response ( @version , status , { } )
19
20
write_body ( @version , nil )
20
- rescue Errno ::ECONNRESET , Errno ::EPIPE
21
- # Nothing we can do...
21
+ rescue => error
22
+ # At this point, there is very little we can do to recover:
23
+ Console ::Event ::Failure . for ( error ) . emit ( self , "Failed to write failure response." , severity : :debug )
22
24
end
23
25
24
26
def next_request
@@ -33,7 +35,7 @@ def next_request
33
35
end
34
36
35
37
return request
36
- rescue Async ::TimeoutError
38
+ rescue Async ::TimeoutError , IO :: TimeoutError
37
39
# For an interesting discussion about this behaviour, see https://trac.nginx.org/nginx/ticket/1005
38
40
# If you enable this, you will see some spec failures...
39
41
# fail_request(408)
You can’t perform that action at this time.
0 commit comments