Function: error
error is a byte-compiled function defined in subr.el.gz.
Signature
(error STRING &rest ARGS)
Documentation
Signal an error, making a message by passing ARGS to format-message.
Errors cause entry to the debugger when debug-on-error is non-nil.
This can be overridden by debug-ignored-errors.
When noninteractive is non-nil (in particular, in batch mode), an
unhandled error calls kill-emacs, which terminates the Emacs
session with a non-zero exit code.
To signal with MESSAGE without interpreting format characters
like %, ``' and \=', use (error "%s" MESSAGE).
In Emacs, the convention is that error messages start with a capital
letter but *do not* end with a period. Please follow this convention
for the sake of consistency.
To alter the look of the displayed error messages, you can use
the command-error-function variable.
Probably introduced at or before Emacs version 1.10.
Aliases
Source Code
;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defun error (string &rest args)
"Signal an error, making a message by passing ARGS to `format-message'.
Errors cause entry to the debugger when `debug-on-error' is non-nil.
This can be overridden by `debug-ignored-errors'.
When `noninteractive' is non-nil (in particular, in batch mode), an
unhandled error calls `kill-emacs', which terminates the Emacs
session with a non-zero exit code.
To signal with MESSAGE without interpreting format characters
like `%', `\\=`' and `\\='', use (error \"%s\" MESSAGE).
In Emacs, the convention is that error messages start with a capital
letter but *do not* end with a period. Please follow this convention
for the sake of consistency.
To alter the look of the displayed error messages, you can use
the `command-error-function' variable."
(declare (ftype (function (string &rest t) nil)))
(signal 'error (list (apply #'format-message string args))))