Use Ruby 2.x compatible rescue clauses

Ruby 2.x doesn't support non-class/module arguments to rescue clauses.
Ruby 1.9 only supported it due to what is now considered a regression:

https://bugs.ruby-lang.org/issues/4438

Remove string arguments from rescue clauses to prevent TypeErrors from
being raised during rescue attempts.
Merge pull request #1296 from ironcladlou/ruby2-exception-handling

Use Ruby 2.x compatible rescue clauses