Skip to content

Commit d4da564

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: test/async/websocket/client.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
connection.write(message)
1818
end
1919

20-
connection.close
20+
connection.shutdown
2121
rescue Protocol::WebSocket::ClosedError
2222
# Ignore this error.
23+
ensure
24+
connection.close
2325
end or Protocol::HTTP::Response[404, {}, []]
2426
end
2527
end
@@ -56,6 +58,7 @@
5658
expect(message.to_str).to be == "Hello World!"
5759

5860
connection.close
61+
5962
expect(task.children).to be(:empty?)
6063
end.wait
6164
end
@@ -68,6 +71,7 @@
6871
expect(message.to_str).to be == "Hello World!"
6972

7073
connection.close(Protocol::WebSocket::Error::GOING_AWAY, "Bye!")
74+
7175
expect(task.children).to be(:empty?)
7276
end.wait
7377
end

0 commit comments

Comments
 (0)