Function: comp--error-add-context

comp--error-add-context is a byte-compiled function defined in comp.el.gz.

Signature

(comp--error-add-context ERR CTXT)

Documentation

Add context information CTXT to the error descriptor ERR.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/comp.el.gz
(defun comp--error-add-context (err ctxt)
  "Add context information CTXT to the error descriptor ERR."
  ;; There is currently no agreed upon way to do that, and if we want the
  ;; context to be displayed, the only option currently is to add elements
  ;; to the error descriptor.
  (let ((err-data (cdr err)))
    (setf (cdr err)
	  (if (not (listp err-data)) ;; This should never happen.
              (list err-data ctxt)
            ;; We can't just insert arbitrary info in the
            ;; error-data part of an error: the handler may
            ;; expect specific data at specific positions,
            ;; so add our info at the end.
            (append err-data (list ctxt))))))