Module | Sequel::ErrorSQL |
In: |
lib/sequel/extensions/error_sql.rb
|
Store the SQL related to the exception with the exception, so it is available for DatabaseError#sql later.
# File lib/sequel/extensions/error_sql.rb, line 48 48: def log_exception(exception, message) 49: exception.instance_variable_set(:@sequel_error_sql, message) 50: super 51: end
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.
# File lib/sequel/extensions/error_sql.rb, line 56 56: def log_yield(sql, args=nil) 57: if @loggers.empty? 58: begin 59: yield 60: rescue => e 61: sql = "#{sql}; #{args.inspect}" if args 62: e.instance_variable_set(:@sequel_error_sql, sql) 63: raise 64: end 65: else 66: super 67: end 68: end