Sha256: db8e4b91b76fd4c053b50eb43a4f2c57f22716691d24807c256a1033c9766aaf

Contents?: true

Size: 503 Bytes

Versions: 43

Compression:

Stored size: 503 Bytes

Contents

module Sentry
  module Rails
    class RescuedExceptionInterceptor
      def initialize(app)
        @app = app
      end

      def call(env)
        return @app.call(env) unless Sentry.initialized?

        begin
          @app.call(env)
        rescue => e
          env["sentry.rescued_exception"] = e if report_rescued_exceptions?
          raise e
        end
      end

      def report_rescued_exceptions?
        Sentry.configuration.rails.report_rescued_exceptions
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
sentry-rails-5.20.1 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.20.0 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.19.0 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.18.2 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.18.1 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.18.0 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.17.3 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.17.2 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.17.1 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.17.0 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.16.1 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.15.2 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.15.1 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.15.0 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.14.0 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.13.0 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.12.0 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.11.0 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.10.0 lib/sentry/rails/rescued_exception_interceptor.rb
sentry-rails-5.9.0 lib/sentry/rails/rescued_exception_interceptor.rb