Function: ignore-errors

ignore-errors is a macro defined in subr.el.gz.

Signature

(ignore-errors &rest BODY)

Documentation

Execute BODY; if an error occurs, return nil.

Otherwise, return result of last form in BODY. See also with-demoted-errors that does something similar without silencing all errors.

Probably introduced at or before Emacs version 23.1.

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defmacro ignore-errors (&rest body)
  "Execute BODY; if an error occurs, return nil.
Otherwise, return result of last form in BODY.
See also `with-demoted-errors' that does something similar
without silencing all errors."
  (declare (debug t) (indent 0))
  `(condition-case nil (progn ,@body) (error nil)))