8000 Improved error handling. · socketry/async-websocket@eb3b984 · GitHub
[go: up one dir, main page]

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)
0