Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 15971c3d51f549d91cf000d7c664ffb4335bef03 1 parent b8d9319
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  railties/lib/rails/commands/console.rb
View
2  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

@sikachu
Collaborator

I like that. Thank you. :)

Please sign in to comment.
Something went wrong with that request. Please try again.