Class | Sequel::DatabaseError |
In: |
lib/sequel/extensions/error_sql.rb
|
Parent: | Object |
Get the SQL code that caused this error to be raised.
# File lib/sequel/extensions/error_sql.rb, line 39 39: def sql 40: # We store the error SQL in the wrapped exception instead of the 41: # current exception, since when the error SQL is originally associated 42: # with the wrapped exception, the current exception doesn't exist. It's 43: # possible to copy the error SQL into the current exception, but there 44: # doesn't seem to be a reason to do that. 45: wrapped_exception.instance_variable_get(:@sequel_error_sql) if wrapped_exception 46: end