From fc416d3721a019efbbd249abfb5ab7daf34c2a64 Mon Sep 17 00:00:00 2001 From: edwardmp Date: Fri, 14 Apr 2017 15:25:08 +0200 Subject: [PATCH] Log any errors originating from the socket --- actioncable/CHANGELOG.md | 6 ++++++ actioncable/lib/action_cable/connection/base.rb | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/actioncable/CHANGELOG.md b/actioncable/CHANGELOG.md index d5bd58cfdb..f0502c06ff 100644 --- a/actioncable/CHANGELOG.md +++ b/actioncable/CHANGELOG.md @@ -1 +1,7 @@ +* ActionCable socket errors are now logged to the console + + Previously any socket errors were ignored and this made it hard to diagnose socket issues (e.g. as discussed in #28362). + + *Edward Poot* + Please check [5-1-stable](https://github.com/rails/rails/blob/5-1-stable/actioncable/CHANGELOG.md) for previous changes. diff --git a/actioncable/lib/action_cable/connection/base.rb b/actioncable/lib/action_cable/connection/base.rb index 0a517a532d..ac5f405dea 100644 --- a/actioncable/lib/action_cable/connection/base.rb +++ b/actioncable/lib/action_cable/connection/base.rb @@ -126,7 +126,8 @@ module ActionCable end def on_error(message) # :nodoc: - # ignore + # log errors to make diagnosing socket errors easier + logger.error "WebSocket error occurred: #{message}" end def on_close(reason, code) # :nodoc: