Public Instance methods
log_exception
(exception, message)
Store the SQL related to the exception with the exception, so it is available for Sequel::DatabaseError#sql later.
[show source]
# File lib/sequel/extensions/error_sql.rb, line 47 def log_exception(exception, message) exception.instance_variable_set(:@sequel_error_sql, message) super end
log_yield
(sql, args=nil)
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 Sequel::DatabaseError#sql later.
[show source]
# File lib/sequel/extensions/error_sql.rb, line 55 def log_yield(sql, args=nil) if @loggers.empty? begin yield rescue => e sql = "#{sql}; #{args.inspect}" if args e.instance_variable_set(:@sequel_error_sql, sql) raise end else super end end