From 013fc614040c72cc4ea04d3fafbd69f4986adeb9 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 27 May 2010 11:04:04 -0700 Subject: [PATCH] Don't rewrap system level exceptions with StatementInvalid --- .../connection_adapters/abstract_adapter.rb | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index b225776..b8a6a71 100755 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -211,6 +211,12 @@ module ActiveRecord log_info(sql, name, 0) nil end + rescue SystemExit, SignalException, NoMemoryError => e + # Don't re-wrap these exceptions. They are probably not being caused by invalid + # sql, but rather some external stimulus beyond the responsibilty of this code. + # Additionaly, wrapping these exceptions with StatementInvalid would lead to + # meaningful loss of data, such as losing SystemExit#status. + raise e rescue Exception => e # Log message and raise exception. # Set last_verification to 0, so that connection gets verified -- 1.7.0