Here is a list of the more important error symbols in standard Emacs, grouped by concept. The list includes each symbol’s message and a cross reference to a description of how the error can occur.
Each error symbol has a set of parent error conditions that is a
list of symbols. Normally this list includes the error symbol itself
and the symbol error. Occasionally it includes additional
symbols, which are intermediate classifications, narrower than
error but broader than a single error symbol. For example, all
the errors in accessing files have the condition file-error. If
we do not say here that a certain error symbol has additional error
conditions, that means it has none.
As a special exception, the error symbols quit and
minibuffer-quit don’t have the condition error, because
quitting is not considered an error.
Most of these error symbols are defined in C (mainly data.c),
but some are defined in Lisp. For example, the file userlock.el
defines the file-locked and file-supersession errors.
Several of the specialized Lisp libraries distributed with Emacs
define their own error symbols. We do not attempt to list of all
those here.
See 错误, for an explanation of how errors are generated and handled.
errorThe message is ‘error’. See 错误.
quitThe message is ‘Quit’. See Quitting.
minibuffer-quitThe message is ‘Quit’. This is a subcategory of quit.
See Quitting.
args-out-of-rangeThe message is ‘Args out of range’. This happens when trying to access an element beyond the range of a sequence, buffer, or other container-like object. See 序列、数组与向量, and see Text.
arith-errorThe message is ‘Arithmetic error’. This occurs when trying to perform integer division by zero. See 数值转换, and see 算术运算.
beginning-of-bufferThe message is ‘Beginning of buffer’. See Motion by Characters.
buffer-read-onlyThe message is ‘Buffer is read-only’. See Read-Only Buffers.
circular-listThe message is ‘List contains a loop’. This happens when a circular structure is encountered. See 循环对象的读取语法.
cl-assertion-failedThe message is ‘Assertion failed’. This happens when the
cl-assert macro fails a test. See Assertions in Common Lisp
Extensions.
coding-system-errorThe message is ‘Invalid coding system’. See Coding Systems in Lisp.
cyclic-function-indirectionThe message is ‘Symbol's chain of function indirections contains a loop’. See 符号函数间接引用.
cyclic-variable-indirectionThe message is ‘Symbol's chain of variable indirections contains a loop’. See 变量别名.
dbus-errorThe message is ‘D-Bus error’. See Errors and Events in D-Bus integration in Emacs.
end-of-bufferThe message is ‘End of buffer’. See Motion by Characters.
end-of-fileThe message is ‘End of file during parsing’. Note that this is
not a subcategory of file-error, because it pertains to the
Lisp reader, not to file I/O. See 输入函数.
file-already-existsThis is a subcategory of file-error. See Writing to Files.
permission-deniedThis is a subcategory of file-error, which occurs when the OS
doesn’t allow Emacs to access a file or a directory for some reason.
file-date-errorThis is a subcategory of file-error. It occurs when
copy-file tries and fails to set the last-modification time of
the output file. See Changing File Names and Attributes.
file-errorWe do not list the error-strings of this error and its subcategories,
because the error message is normally constructed from the data items
alone when the error condition file-error is present. Thus,
the error-strings are not very relevant. However, these error symbols
do have error-message properties, and if no data is provided,
the error-message property is used. See Files.
file-missingThis is a subcategory of file-error. It occurs when an
operation attempts to act on a file that is missing. See Changing File Names and Attributes.
compression-errorThis is a subcategory of file-error, which results from
problems handling a compressed file. See 程序的加载方式.
file-lockedThis is a subcategory of file-error. See File Locks.
file-supersessionThis is a subcategory of file-error. See Buffer Modification Time.
file-notify-errorThis is a subcategory of file-error. It happens, when a file
could not be watched for changes. See Notifications on File Changes.
remote-file-errorThis is a subcategory of file-error, which results from
problems in accessing a remote file. See Remote Files in The
GNU Emacs Manual. Often, this error appears when timers, process
filters, process sentinels or special events in general try to access
a remote file, and collide with another remote file operation. In
general it is a good idea to write a bug report.
See Bugs in The GNU Emacs Manual.
ftp-errorThis is a subcategory of remote-file-error, which results from
problems in accessing a remote file using ftp. See Remote Files in The GNU Emacs Manual.
invalid-functionThe message is ‘Invalid function’. See 符号函数间接引用.
invalid-read-syntaxThe message is usually ‘Invalid read syntax’. See 打印表示与读入语法. This error can also be raised by commands like
eval-expression when there’s text following an expression. In
that case, the message is ‘Trailing garbage following expression’.
invalid-regexpThe message is ‘Invalid regexp’. See Regular Expressions.
mark-inactiveThe message is ‘The mark is not active now’. See The Mark.
no-catchThe message is ‘No catch for tag’. See 显式非局部退出:catch 和 throw.
range-errorThe message is Arithmetic range error.
overflow-errorThe message is ‘Arithmetic overflow error’. This is a subcategory
of range-error.
This can happen with integers exceeding the integer-width limit.
See 整数基础.
scan-errorThe message is ‘Scan error’. This happens when certain syntax-parsing functions find invalid syntax or mismatched parentheses. Conventionally raised with three argument: a human-readable error message, the start of the obstacle that cannot be moved over, and the end of the obstacle. See Moving over Balanced Expressions, and see Parsing Expressions.
search-failedThe message is ‘Search failed’. See Searching and Matching.
setting-constantThe message is ‘Attempt to set a constant symbol’. This happens
when attempting to assign values to nil, t,
most-positive-fixnum, most-negative-fixnum, and keyword
symbols. It also happens when attempting to assign values to
enable-multibyte-characters and some other symbols whose direct
assignment is not allowed for some reason. See 永不改变的变量.
text-read-onlyThe message is ‘Text is read-only’. This is a subcategory of
buffer-read-only. See Properties with Special Meanings.
undefined-colorThe message is ‘Undefined color’. See Color Names.
user-errorThe message is the empty string. See 如何发出错误信号.
user-search-failedThis is like ‘search-failed’, but doesn’t trigger the debugger, like ‘user-error’. See 如何发出错误信号, and see Searching and Matching. This is used for searching in Info files, see Search Text in Info.
void-functionThe message is ‘Symbol's function definition is void’. See 访问函数单元内容.
void-variableThe message is ‘Symbol's value as variable is void’. See 访问变量值.
wrong-number-of-argumentsThe message is ‘Wrong number of arguments’. See 参数列表的特性.
wrong-type-argumentThe message is ‘Wrong type argument’. See 类型谓词.
unknown-image-typeThe message is ‘Cannot determine image type’. See Images.
inhibited-interactionThe message is ‘User interaction while inhibited’. This error is
signaled when inhibit-interaction is non-nil and a user
interaction function (like read-from-minibuffer) is called.