rails/rails — pull request #6759 by dylanahsmith (2012-06-17 08:10:12+00:00)
Title: Avoid unnecessary catching of Exception instead of StandardError.

Non-`StandardError` `Exception`s are generally not meant to be caught without re-raising the exception, because they are often unrecoverable errors. I found some instances of these exceptions being unnecessarily caught.

For reference, here are a list of non-`StandardError` exceptions from a fresh irb session.

```ruby
ObjectSpace.each_object(Class) do |c|
c < Exception && !(c < StandardError) && puts("#{c.name} < #{c.superclass}")
end
```
```ruby
Gem::LoadError < LoadError
SystemStackError < Exception
NoMemoryError < Exception
SecurityError < Exception
NotImplementedError < ScriptError
LoadError < ScriptError
SyntaxError < ScriptError
ScriptError < Exception
StandardError < Exception
Interrupt < SignalException
SignalException < Exception
fatal < Exception
SystemExit < Exception
Gem::SystemExitException < SystemExit
IRB::Abort < Exception
```

If one of the above exceptions does need to be caught, it would make more sense to specify a more specific exception class to catch (e.g. `ScriptError` when dynamically loading scripts). However, the lines I changed didn't need to catch serious errors like those listed above.