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 eb3b984
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,13 @@
connection.write(message)
end

connection.close
connection.shutdown
rescue Protocol::WebSocket::ClosedError
# Ignore this error.
rescue Errno::EPIPE
# Ignore this error: the client has closed the connection ungracefully.
ensure
connection.close
end or Protocol::HTTP::Response[404, {}, []]
end
end
Expand Down

0 comments on commit eb3b984

Please sign in to comment.