diff options
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb index c8c3fcb22a..32e3c7f5d8 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb @@ -163,8 +163,8 @@ module ActiveRecord 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 @@ module ActiveRecord ensure begin commit_transaction unless error - rescue Exception => e + rescue Exception rollback_transaction raise end |