Class Sequel::DatabaseError
In: lib/sequel/extensions/error_sql.rb
lib/sequel/exceptions.rb
Parent: Object

Generic error raised by the database adapters, indicating a problem originating from the database server. Usually raised because incorrect SQL syntax is used.

Methods

sql  

Public Instance methods

Get the SQL code that caused this error to be raised.

[Source]

    # File lib/sequel/extensions/error_sql.rb, line 35
35:     def sql
36:       # We store the error SQL in the wrapped exception instead of the
37:       # current exception, since when the error SQL is originally associated
38:       # with the wrapped exception, the current exception doesn't exist.  It's
39:       # possible to copy the error SQL into the current exception, but there
40:       # doesn't seem to be a reason to do that.
41:       wrapped_exception.instance_variable_get(:@sequel_error_sql) if wrapped_exception
42:     end

[Validate]