Sha256: afd70ad1877cbac9b18de121f1eb862e2984c2fb704f858ee344c5debbe9d0b1

Contents?: true

Size: 461 Bytes

Versions: 6

Compression:

Stored size: 461 Bytes

Contents

module Ezlog
  module Rails
    class LogExceptions
      def initialize(app, logger)
        @app = app
        @logger = logger
      end

      def call(env)
        @app.call(env)
      rescue Exception => exception
        @logger.error exception unless handled?(exception)
        raise
      end

      private

      def handled?(exception)
        ActionDispatch::ExceptionWrapper.rescue_responses.key? exception.class.name
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ezlog-0.10.7 lib/ezlog/rails/log_exceptions.rb
ezlog-0.10.5 lib/ezlog/rails/log_exceptions.rb
ezlog-0.10.3 lib/ezlog/rails/log_exceptions.rb
ezlog-0.10.2 lib/ezlog/rails/log_exceptions.rb
ezlog-0.10.1 lib/ezlog/rails/log_exceptions.rb
ezlog-0.10.0 lib/ezlog/rails/log_exceptions.rb