lib/sentry/rails/action_cable.rb in sentry-rails-4.9.1 vs lib/sentry/rails/action_cable.rb in sentry-rails-4.9.2
- old
+ new
@@ -2,9 +2,10 @@
module Rails
module ActionCableExtensions
class ErrorHandler
class << self
def capture(connection, transaction_name:, extra_context: nil, &block)
+ return block.call unless Sentry.initialized?
# ActionCable's ConnectionStub (for testing) doesn't implement the exact same interfaces as Connection::Base.
# One thing that's missing is `env`. So calling `connection.env` direclty will fail in test environments when `stub_connection` is used.
# See https://github.com/getsentry/sentry-ruby/pull/1684 for more information.
env = connection.respond_to?(:env) ? connection.env : {}