define-error

define-error is a compiled Lisp function in `subr.el'.

(define-error NAME MESSAGE &optional PARENT)

Define NAME as a new error signal.
MESSAGE is a string that will be output to the echo area if such an error
is signaled without being caught by a `condition-case'.
PARENT is either a signal or a list of signals from which it inherits.
Defaults to `error'.