Skip to content

Instantly share code, notes, and snippets.

@woodie
Created December 31, 2009 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woodie/266649 to your computer and use it in GitHub Desktop.
Save woodie/266649 to your computer and use it in GitHub Desktop.
Rails 3 error logging bug
# Rails 3 needs error logging
~/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb
private
def render_exception(env, exception)
# ------------------------------------------- #
puts exception.to_s # show me the error please!
# ------------------------------------------- #
log_error(exception)
request = Request.new(env)
if @consider_all_requests_local || local_request?(request)
rescue_action_locally(request, exception)
else
rescue_action_in_public(exception)
end
rescue Exception => failsafe_error
$stderr.puts "Error during failsafe response: #{failsafe_error}"
FAILSAFE_RESPONSE
end
__END__
# nice!
no such file to load -- sqlite3
# nope
Error during failsafe response: can't convert Array into String
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment