notify-on-error 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/application_controller.rb +13 -12
- metadata +3 -3
@@ -9,19 +9,20 @@ module NotifyOnError
|
|
9
9
|
Rails.logger.error( "Exception found #{ex.exception}")
|
10
10
|
Rails.logger.error( "Parameters #{params.inspect}")
|
11
11
|
Rails.logger.error( ex.backtrace.join("\n") )
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
ErrorMailer.exception_email(ex).deliver
|
12
|
+
if NotifyOnError.notification_environments.map(&:to_s).include?( Rails.env )
|
13
|
+
case NotifyOnError.notification_method
|
14
|
+
when :action_mailer
|
15
|
+
Rails.logger.error( "Notify via ActionMailer" )
|
16
|
+
ErrorMailer.exception_email(ex).deliver
|
17
|
+
else
|
18
|
+
Rails.logger.error( "Unrecognized notification method(#{NotifyOnError.notification_method})" )
|
19
|
+
end #case
|
21
20
|
else
|
22
|
-
Rails.logger.error( "
|
23
|
-
end
|
24
|
-
|
21
|
+
Rails.logger.error( "Suppressing notification because of environment(#{Rails.env})" )
|
22
|
+
end
|
23
|
+
|
24
|
+
render :status => 500
|
25
|
+
end #rescue
|
25
26
|
end
|
26
27
|
|
27
28
|
module InstanceMethods
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 1
|
9
|
+
version: 1.0.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Paul Santa Clara
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-08-
|
17
|
+
date: 2011-08-16 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|