Sha256: 697f5cc4b1f7a248363f80d6c07e31cff89fe81dc2cd61920f2a28947e4a4486

Contents?: true

Size: 1.01 KB

Versions: 13

Compression:

Stored size: 1.01 KB

Contents

module Rollbar
  module Middleware
    module Rails
      module ShowExceptions
        include ExceptionReporter

        def render_exception_with_rollbar(env, exception)
          key = 'action_dispatch.show_detailed_exceptions'

          # don't report production exceptions here as it is done below
          # in call_with_rollbar() when show_detailed_exception is false
          if not env.has_key?(key) or env[key]
            report_exception_to_rollbar(env, exception)
          end
          render_exception_without_rollbar(env, exception)
        end

        def call_with_rollbar(env)
          call_without_rollbar(env)
        rescue Exception => exception
          # won't reach here if show_detailed_exceptions is true
          report_exception_to_rollbar(env, exception)
          raise exception
        end

        def self.included(base)
          base.send(:alias_method_chain, :call, :rollbar)
          base.send(:alias_method_chain, :render_exception, :rollbar)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rollbar-1.1.0 lib/rollbar/middleware/rails/show_exceptions.rb
rollbar-1.0.1 lib/rollbar/middleware/rails/show_exceptions.rb
rollbar-1.0.0 lib/rollbar/middleware/rails/show_exceptions.rb
rollbar-0.13.2 lib/rollbar/middleware/rails/show_exceptions.rb
rollbar-0.13.1 lib/rollbar/middleware/rails/show_exceptions.rb
rollbar-0.13.0 lib/rollbar/middleware/rails/show_exceptions.rb
rollbar-0.12.20 lib/rollbar/middleware/rails/show_exceptions.rb
rollbar-0.12.19 lib/rollbar/middleware/rails/show_exceptions.rb
rollbar-0.12.18 lib/rollbar/middleware/rails/show_exceptions.rb
rollbar-0.12.17 lib/rollbar/middleware/rails/show_exceptions.rb
rollbar-0.12.16 lib/rollbar/middleware/rails/show_exceptions.rb
rollbar-0.12.15 lib/rollbar/middleware/rails/show_exceptions.rb
rollbar-0.12.14 lib/rollbar/middleware/rails/show_exceptions.rb