Permalink
Browse files

Don't rewrap system level exceptions with StatementInvalid

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#896 state:committed]
  • Loading branch information...
1 parent b760d69 commit 3d6ed501870f2a790c2d0e288e0f294e8c5f7be3 Andrew committed with NZKoz May 27, 2010
Showing with 6 additions and 0 deletions.
  1. +6 −0 activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
View
6 activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
@@ -211,6 +211,12 @@ def log(sql, name)
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

0 comments on commit 3d6ed50

Please sign in to comment.