Skip to content

Advanced Debugging #81

@kilianmh

Description

@kilianmh

When using mito:insert-dao, I got a nasty error in a big inserting operation:

The value ... is not of type
  (OR
   (AND #1=(SATISFIES SXQL.SQL-TYPE:SQL-EXPRESSION-LIST-P)
        #2=(SATISFIES TRIVIAL-TYPES:PROPER-LIST-P) CONS)
   (AND #1# #2# NULL))

I thought it could be useful for debugging if we let sql-expression-list-p (and other predicate functions?) give a warning which specific element produced the failure:

This examplary code

(defun sql-expression-list-p (object)
  (if (every #'sql-expression-p object)
      t
      (let ((faulty-expressions
	      nil))
	(mapc (lambda (expression)
	      (unless (sql-expression-p expression)
		(push expression faulty-expressions)))
	    object)
      (warn "The values ~A are not of type sql-expression." (reverse faulty-expressions)))))

would produce an additional warning in the standard output such as:

WARNING:
   The values ((#S(SQL-VARIABLE
                   :VALUE example-value))) are not of type sql-expression.

Do you like the idea, or is it overkill? @fukamachi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions