mrhenry-failtale-reporter 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/failtale_reporter.rb +3 -3
- data/lib/failtale_reporter/adapters/rails.rb +4 -4
- data/lib/failtale_reporter/error.rb +1 -1
- data/rails/init.rb +1 -1
- metadata +1 -1
data/lib/failtale_reporter.rb
CHANGED
|
@@ -8,11 +8,11 @@ end
|
|
|
8
8
|
|
|
9
9
|
require File.dirname(__FILE__)+'/failtale_reporter/error'
|
|
10
10
|
|
|
11
|
-
module
|
|
11
|
+
module FailtaleReporter
|
|
12
12
|
|
|
13
13
|
include HTTParty
|
|
14
14
|
|
|
15
|
-
base_uri '
|
|
15
|
+
base_uri 'failtale.be'
|
|
16
16
|
format :xml
|
|
17
17
|
|
|
18
18
|
def self.load_adapter(name)
|
|
@@ -47,7 +47,7 @@ module ErrorReporter
|
|
|
47
47
|
|
|
48
48
|
def self.handle_exception(exception)
|
|
49
49
|
return exception if exception.nil?
|
|
50
|
-
return exception if exception.is_a?
|
|
50
|
+
return exception if exception.is_a? FailtaleReporter::Error
|
|
51
51
|
return nil unless reportable_exceptions.any? {|c| exception.is_a? c }
|
|
52
52
|
return nil if ignored_exceptions.any? {|c| exception.is_a? c }
|
|
53
53
|
Error.new(exception)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
module
|
|
2
|
+
module FailtaleReporter
|
|
3
3
|
module Adapters
|
|
4
4
|
|
|
5
5
|
module Rails
|
|
@@ -12,14 +12,14 @@ module ErrorReporter
|
|
|
12
12
|
def self.included(target)
|
|
13
13
|
target.send :alias_method_chain, :rescue_action_in_public, :errors
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
FailtaleReporter.configure do |config|
|
|
16
16
|
config.ignored_exceptions IGNORED_EXCEPTIONS
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def rescue_action_in_public_with_errors(exception)
|
|
21
21
|
is_private = ::Rails.env.development? or ::Rails.env.test?
|
|
22
|
-
|
|
22
|
+
FailtaleReporter.report(exception) unless is_private
|
|
23
23
|
rescue_action_in_public_without_errors(exception)
|
|
24
24
|
end
|
|
25
25
|
|
|
@@ -28,4 +28,4 @@ module ErrorReporter
|
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
::ActionController::Base.send :include,
|
|
31
|
+
::ActionController::Base.send :include, FailtaleReporter::Adapters::Rails
|
data/rails/init.rb
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
::
|
|
2
|
+
::FailtaleReporter.load_adapter('rails')
|