Rescue from logging errors after filter run

This commit is contained in:
Jon Moses 2011-05-08 13:14:40 -04:00
parent 677b66b3d2
commit 8a9950bba9
2 changed files with 6 additions and 2 deletions

View File

@ -20,7 +20,11 @@ module AbstractController::Callbacks::ClassMethods
define_method("#{filter_name}_with_logging") do
Rails.logger.debug("Entering before_filter: #{filter_name}")
send(filter_name).tap do |result|
Rails.logger.debug(" result: #{result.inspect}")
begin
Rails.logger.debug(" result: #{result.inspect}")
rescue
Rails.logger.debug(" error outputting result: #{$!.class.name}/#{$!.message}")
end
end
end
end

View File

@ -1,3 +1,3 @@
module ControllerFilterLogging
VERSION = "0.0.2"
VERSION = "0.0.3"
end