diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-09-15 10:44:12 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-09-15 10:44:12 +0100 |
commit | c46208c2aa64414f0e1298ed494e864884f13a32 (patch) | |
tree | c86aae39dc36c7dea5413c2c39de0f35e7a98ebd | |
parent | 60c88e64e26682a954f7c8cd6669d409ffffcc8b (diff) | |
download | rails-c46208c2aa64414f0e1298ed494e864884f13a32.tar.gz rails-c46208c2aa64414f0e1298ed494e864884f13a32.tar.bz2 rails-c46208c2aa64414f0e1298ed494e864884f13a32.zip |
simplify rescue
-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 |