Permalink
Browse files

Remove unnecessary begin..rescue..end, use only rescue

  • Loading branch information...
1 parent 2269f43 commit 28fd867c9bc790636d37a28f288791cd0089a6fd @carlosantoniodasilva carlosantoniodasilva committed Jan 5, 2013
Showing with 5 additions and 7 deletions.
  1. +5 −7 railties/lib/rails/commands/console.rb
@@ -89,13 +89,11 @@ def start
end
def require_debugger
- begin
- require 'debugger'
- puts "=> Debugger enabled"
- rescue Exception
- puts "You're missing the 'debugger' gem. Add it to your Gemfile, bundle, and try again."
- exit
- end
+ require 'debugger'
+ puts "=> Debugger enabled"
+ rescue Exception
+ puts "You're missing the 'debugger' gem. Add it to your Gemfile, bundle, and try again."
+ exit
@tenderlove

tenderlove Jan 5, 2013

Owner

Shouldn't we raise the exception? If something in the debugger gem is broken, the process will just exit even though the gem is installed. :(

@sikachu

sikachu Jan 5, 2013

Member

Agreed. I think we should ... and why not just catching LoadError (or something?)

@carlosantoniodasilva

carlosantoniodasilva Jan 5, 2013

Owner

Alright, lets change. As a side note, this has been like that since ever.

@carlosantoniodasilva

carlosantoniodasilva Jan 6, 2013

Owner

Does 15971c3 handle your concerns, or should we just get rid of the rescue altogether?

end
end
end

0 comments on commit 28fd867

Please sign in to comment.