Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Don't rewrap system level exceptions with StatementInvalid

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#896 state:committed]
  • Loading branch information...
commit 3d6ed501870f2a790c2d0e288e0f294e8c5f7be3 1 parent b760d69
authored May 27, 2010 NZKoz committed May 29, 2010
6  activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
@@ -211,6 +211,12 @@ def log(sql, name)
211 211
             log_info(sql, name, 0)
212 212
             nil
213 213
           end
  214
+        rescue SystemExit, SignalException, NoMemoryError => e
  215
+          # Don't re-wrap these exceptions. They are probably not being caused by invalid
  216
+          # sql, but rather some external stimulus beyond the responsibilty of this code.
  217
+          # Additionaly, wrapping these exceptions with StatementInvalid would lead to
  218
+          #  meaningful loss of data, such as losing SystemExit#status.
  219
+          raise e
214 220
         rescue Exception => e
215 221
           # Log message and raise exception.
216 222
           # Set last_verification to 0, so that connection gets verified

0 notes on commit 3d6ed50

Please sign in to comment.
Something went wrong with that request. Please try again.