Skip to content

Commit eb3b984

Browse files
committed
Improved error handling.
1 parent 5b5288d commit eb3b984

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/async/websocket/client.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@
1717
connection.write(message)
1818
end
1919

20-
connection.close
20+
connection.shutdown
2121
rescue Protocol::WebSocket::ClosedError
2222
# Ignore this error.
23+
rescue Errno::EPIPE
24+
# Ignore this error: the client has closed the connection ungracefully.
25+
ensure
26+
connection.close
2327
end or Protocol::HTTP::Response[404, {}, []]
2428
end
2529
end

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy