Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

simplify rescue

  • Loading branch information...
commit c46208c2aa64414f0e1298ed494e864884f13a32 1 parent 60c88e6
@jonleighton jonleighton authored
View
6 activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -163,8 +163,8 @@ def transaction(options = {})
else
within_new_transaction(options) { yield }
end
- rescue Exception => error
- raise unless error.is_a?(ActiveRecord::Rollback)
+ rescue ActiveRecord::Rollback
+ # rollbacks are silently swallowed
end
def within_new_transaction(options = {}) #:nodoc:
@@ -176,7 +176,7 @@ def within_new_transaction(options = {}) #:nodoc:
ensure
begin
commit_transaction unless error
- rescue Exception => e
+ rescue Exception
rollback_transaction
raise
end
Please sign in to comment.
Something went wrong with that request. Please try again.