Function: error-has-type-p

error-has-type-p is a byte-compiled function defined in subr.el.gz.

Signature

(error-has-type-p ERROR CONDITION)

Documentation

Return non-nil if ERROR is of type CONDITION (or a subtype of it).

View in manual

Probably introduced at or before Emacs version 31.1.

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defun error-has-type-p (error condition)
  "Return non-nil if ERROR is of type CONDITION (or a subtype of it)."
  (unless (error--p error)
    (signal 'wrong-type-argument (list #'error--p error)))
  (or (eq condition t)
      (memq condition (get (car error) 'error-conditions))))