failtale-reporter 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -19,12 +19,12 @@ module FailtaleReporter::Adapters::Rails
|
|
19
19
|
IGNORED_EXCEPTIONS.freeze
|
20
20
|
|
21
21
|
def self.included(target)
|
22
|
-
target.send :alias_method_chain, :
|
22
|
+
target.send :alias_method_chain, :rescue_action, :failtale
|
23
23
|
|
24
24
|
FailtaleReporter.configure do |config|
|
25
25
|
config.ignored_exceptions IGNORED_EXCEPTIONS
|
26
26
|
config.default_reporter "rails"
|
27
|
-
config.application_root
|
27
|
+
config.application_root Rails.root
|
28
28
|
config.information_collector do |error, controller|
|
29
29
|
env = error.environment
|
30
30
|
env = env.merge(controller.request.env)
|
@@ -36,16 +36,15 @@ module FailtaleReporter::Adapters::Rails
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
39
|
+
def rescue_action_with_failtale(exception)
|
40
40
|
FailtaleReporter.report(exception, self) unless is_private?
|
41
|
-
|
41
|
+
rescue_action_without_failtale(exception)
|
42
42
|
end
|
43
43
|
|
44
44
|
protected
|
45
45
|
|
46
46
|
def is_private?
|
47
|
-
FailtaleReporter.force_public
|
48
|
-
defined?(Rails) and ['development', 'test'].include?(Rails.env))
|
47
|
+
!FailtaleReporter.force_public and %w(development test).include?(Rails.env)
|
49
48
|
end
|
50
49
|
|
51
50
|
end
|