Sha256: 54fee50589e812a8c99471c38d017d17a0aa8e14b213b1ef8e2e200f711a4c68

Contents?: true

Size: 794 Bytes

Versions: 4

Compression:

Stored size: 794 Bytes

Contents

class RailsExceptionHandler

  def initialize(app)
    @app = app
  end

  def call(env)
    @app.call(env)
  rescue Exception => e
    Handler.new(env, e).handle_exception
  end

  def self.configuration
    @configuration ||= Configuration.new
  end

  def self.configure
    yield configuration
    return unless configuration.environments.include?(Rails.env.to_sym)

    Rails.configuration.middleware.use(RailsExceptionHandler)

    Rails.configuration.action_dispatch.show_exceptions = true
    require File.expand_path(File.dirname(__FILE__)) + '/patch/show_exceptions.rb'
  end
end

require 'rails_exception_handler/configuration.rb'
require 'rails_exception_handler/handler.rb'
require 'rails_exception_handler/parser.rb'
require 'rails_exception_handler/engine.rb'
require 'net/http'

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_exception_handler-1.3.0 lib/rails_exception_handler.rb
rails_exception_handler-1.2.1 lib/rails_exception_handler.rb
rails_exception_handler-1.2.0 lib/rails_exception_handler.rb
rails_exception_handler-1.1.2 lib/rails_exception_handler.rb