Permalink
Browse files

Rescue from LoadError when trying to load the debugger gem for console

Avoid swallowing all exceptions that might happen when requiring
debugger, just catch a LoadError if it cannot be loaded.

Check for more background:
28fd867#commitcomment-2386952
  • Loading branch information...
1 parent b8d9319 commit 15971c3d51f549d91cf000d7c664ffb4335bef03 @carlosantoniodasilva carlosantoniodasilva committed Jan 6, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/commands/console.rb
@@ -91,7 +91,7 @@ def start
def require_debugger
require 'debugger'
puts "=> Debugger enabled"
- rescue Exception
+ rescue LoadError
puts "You're missing the 'debugger' gem. Add it to your Gemfile, bundle, and try again."
exit
end

1 comment on commit 15971c3

Member

sikachu commented on 15971c3 Jan 8, 2013

I like that. Thank you. :)

Please sign in to comment.