Function: error-has-type-p

error-has-type-p is a byte-compiled function defined in compat-31.el.

Signature

(error-has-type-p ERROR CONDITION)

Documentation

[Compatibility function for error-has-type-p, defined in Emacs 31.0.50. See
(compat) Emacs 31.0.50' for more details.]

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

Source Code

;; Defined in ~/.emacs.d/elpa/compat-31.0.0.2/compat-31.el
(compat-defun error-has-type-p (error condition) ;; <compat-tests:error-api>
  "Return non-nil if ERROR is of type CONDITION (or a subtype of it)."
  (unless (let ((type (car-safe error)))
            (and type (symbolp type) (listp (cdr error))
                 (error-type-p type)))
    (signal 'wrong-type-argument (list error)))
  (or (eq condition t)
      (memq condition (get (car error) 'error-conditions))))