forked from bjorntrondsen/rails_exception_handler
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rails_exception_handler.rb
43 lines (35 loc) · 1.16 KB
/
rails_exception_handler.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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.activate?
unless Rails.configuration.middleware.class == ActionDispatch::MiddlewareStack && Rails.configuration.middleware.include?(RailsExceptionHandler)
Rails.configuration.middleware.use(RailsExceptionHandler)
end
Rails.configuration.action_dispatch.show_exceptions = true
Rails.configuration.consider_all_requests_local = false
require File.expand_path(File.dirname(__FILE__)) + '/patch/show_exceptions.rb'
configuration.run_callback
end
end
class RailsExceptionHandler::ActiveRecord
end
class RailsExceptionHandler::Mongoid
end
require 'rails_exception_handler/configuration.rb'
require 'rails_exception_handler/handler.rb'
require 'rails_exception_handler/parser.rb'
require 'rails_exception_handler/storage.rb'
require 'rails_exception_handler/engine.rb'
require 'rails_exception_handler/catcher.rb'
require 'net/http'