Skip to content

Commit

Permalink
Improved error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Sep 11, 2024
1 parent 5b5288d commit d4da564
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/async/websocket/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
connection.write(message)
end

connection.close
connection.shutdown
rescue Protocol::WebSocket::ClosedError
# Ignore this error.
ensure
connection.close
end or Protocol::HTTP::Response[404, {}, []]
end
end
Expand Down Expand Up @@ -56,6 +58,7 @@
expect(message.to_str).to be == "Hello World!"

connection.close

expect(task.children).to be(:empty?)
end.wait
end
Expand All @@ -68,6 +71,7 @@
expect(message.to_str).to be == "Hello World!"

connection.close(Protocol::WebSocket::Error::GOING_AWAY, "Bye!")

expect(task.children).to be(:empty?)
end.wait
end
Expand Down

0 comments on commit d4da564

Please sign in to comment.