Permalink
Browse files

Silence log_error deprecation warnings from inspecting deprecated ins…

…tance variables.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5757 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent e56bd3a commit 9a27b29755027d7b2cb5e255276619485f4f5d02 @jeremy jeremy committed Dec 19, 2006
View
@@ -1,5 +1,7 @@
*SVN*
+* Silence log_error deprecation warnings from inspecting deprecated instance variables. [Nate Wiger]
+
* Only cache GET requests with a 200 OK response. #6514, #6743 [RSL, anamba]
* Add a 'referer' attribute to TestRequest. [Jamis Buck]
@@ -59,14 +59,16 @@ def rescue_action(exception)
# Overwrite to implement custom logging of errors. By default logs as fatal.
def log_error(exception) #:doc:
- if ActionView::TemplateError === exception
- logger.fatal(exception.to_s)
- else
- logger.fatal(
- "\n\n#{exception.class} (#{exception.message}):\n " +
- clean_backtrace(exception).join("\n ") +
- "\n\n"
- )
+ ActiveSupport::Deprecation.silence do
+ if ActionView::TemplateError === exception
+ logger.fatal(exception.to_s)
+ else
+ logger.fatal(
+ "\n\n#{exception.class} (#{exception.message}):\n " +
+ clean_backtrace(exception).join("\n ") +
+ "\n\n"
+ )
+ end
end
end
@@ -45,7 +45,13 @@ def test_deprecated_render_parameters
assert_equal "Living in a nested world", @response.body
end
- def test_assertion_failed_error_doesnt_spout_deprecation_warnings
+ def test_log_error_silences_deprecation_warnings
+ get :raises_name_error
+ rescue => e
+ assert_not_deprecated { @controller.send :log_error, e }
+ end
+
+ def test_assertion_failed_error_silences_deprecation_warnings
get :raises_name_error
rescue => e
error = Test::Unit::Error.new('testing ur doodz', e)

0 comments on commit 9a27b29

Please sign in to comment.