module Sequel::ErrorSQL

Public Instance Methods

log_connection_yield(sql, conn, args=nil) { || ... } click to toggle source

If there are no loggers for this database and an exception is raised store the SQL related to the exception with the exception, so it is available for DatabaseError#sql later.

Calls superclass method
   # File lib/sequel/extensions/error_sql.rb
60 def log_connection_yield(sql, conn, args=nil)
61   if @loggers.empty?
62     begin
63       yield
64     rescue => e
65       sql = "#{connection_info(conn) if conn && log_connection_info}#{sql}#{"; #{args.inspect}" if args}"
66       e.instance_variable_set(:@sequel_error_sql, sql)
67       raise
68     end
69   else
70     super
71   end
72 end
log_exception(exception, message) click to toggle source

Store the SQL related to the exception with the exception, so it is available for DatabaseError#sql later.

Calls superclass method
   # File lib/sequel/extensions/error_sql.rb
52 def log_exception(exception, message)
53   exception.instance_variable_set(:@sequel_error_sql, message)
54   super
55 end