errors.texi 7.36 KB
Newer Older
Glenn Morris's avatar
Glenn Morris committed
1 2
@c -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
3
@c Copyright (C) 1990-1993, 1999, 2001-2012 Free Software Foundation, Inc.
Glenn Morris's avatar
Glenn Morris committed
4
@c See the file elisp.texi for copying conditions.
5
@node Standard Errors
Glenn Morris's avatar
Glenn Morris committed
6 7 8
@appendix Standard Errors
@cindex standard errors

Glenn Morris's avatar
Glenn Morris committed
9
  Here is a list of the more important error symbols in standard Emacs,
Glenn Morris's avatar
Glenn Morris committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
grouped by concept.  The list includes each symbol's message (on the
@code{error-message} property of the symbol) and a cross reference to a
description of how the error can occur.

  Each error symbol has an @code{error-conditions} property that is a
list of symbols.  Normally this list includes the error symbol itself
and the symbol @code{error}.  Occasionally it includes additional
symbols, which are intermediate classifications, narrower than
@code{error} but broader than a single error symbol.  For example, all
the errors in accessing files have the condition @code{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 symbol @code{quit} does not have the
condition @code{error}, because quitting is not considered an error.

Glenn Morris's avatar
Glenn Morris committed
26 27 28 29 30 31 32 33 34
@c You can grep for "(put 'foo 'error-conditions ...) to find
@c examples defined in Lisp.  Eg soap-client.el, sasl.el.
  Most of these error symbols are defined in C (mainly @file{data.c}),
but some are defined in Lisp.  For example, the file @file{userlock.el}
defines the @code{file-locked} and @code{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.

Glenn Morris's avatar
Glenn Morris committed
35 36 37 38 39
  @xref{Errors}, for an explanation of how errors are generated and
handled.

@table @code
@item error
40
The message is @samp{error}.  @xref{Errors}.
Glenn Morris's avatar
Glenn Morris committed
41 42

@item quit
43
The message is @samp{Quit}.  @xref{Quitting}.
Glenn Morris's avatar
Glenn Morris committed
44 45

@item args-out-of-range
46 47 48 49
The message is @samp{Args out of range}.  This happens when trying to
access an element beyond the range of a sequence, buffer, or other
container-like object.  @xref{Sequences Arrays Vectors}, and
@xref{Text}.
Glenn Morris's avatar
Glenn Morris committed
50 51

@item arith-error
52 53
The message is @samp{Arithmetic error}.  This occurs when trying to
perform integer division by zero.  @xref{Numeric Conversions}, and
Glenn Morris's avatar
Glenn Morris committed
54 55 56
@xref{Arithmetic Operations}.

@item beginning-of-buffer
57
The message is @samp{Beginning of buffer}.  @xref{Character Motion}.
Glenn Morris's avatar
Glenn Morris committed
58 59

@item buffer-read-only
60
The message is @samp{Buffer is read-only}.  @xref{Read Only Buffers}.
Glenn Morris's avatar
Glenn Morris committed
61

62
@item circular-list
63 64
The message is @samp{List contains a loop}.  This happens when a
circular structure is encountered.  @xref{Circular Objects}.
Glenn Morris's avatar
Glenn Morris committed
65 66

@item cl-assertion-failed
67 68 69
The message is @samp{Assertion failed}.  This happens when the
@code{assert} macro fails a test.  @xref{Assertions,,, cl, Common Lisp
Extensions}.
70

Glenn Morris's avatar
Glenn Morris committed
71
@item coding-system-error
72 73
The message is @samp{Invalid coding system}.  @xref{Lisp and Coding
Systems}.
Glenn Morris's avatar
Glenn Morris committed
74 75

@item cyclic-function-indirection
76 77
The message is @samp{Symbol's chain of function indirections contains
a loop}.  @xref{Function Indirection}.
Glenn Morris's avatar
Glenn Morris committed
78 79

@item cyclic-variable-indirection
80 81
The message is @samp{Symbol's chain of variable indirections contains
a loop}.  @xref{Variable Aliases}.
Glenn Morris's avatar
Glenn Morris committed
82

83
@item dbus-error
84 85 86
The message is @samp{D-Bus error}.  This is only defined if Emacs was
compiled with D-Bus support.  @xref{Errors and Events,,, dbus, D-Bus
integration in Emacs}.
87

Glenn Morris's avatar
Glenn Morris committed
88
@item end-of-buffer
89
The message is @samp{End of buffer}.  @xref{Character Motion}.
Glenn Morris's avatar
Glenn Morris committed
90 91

@item end-of-file
92 93 94
The message is @samp{End of file during parsing}.  Note that this is
not a subcategory of @code{file-error}, because it pertains to the
Lisp reader, not to file I/O.  @xref{Input Functions}.
Glenn Morris's avatar
Glenn Morris committed
95 96

@item file-already-exists
97
This is a subcategory of @code{file-error}.  @xref{Writing to Files}.
Glenn Morris's avatar
Glenn Morris committed
98 99 100 101

@item file-date-error
This is a subcategory of @code{file-error}.  It occurs when
@code{copy-file} tries and fails to set the last-modification time of
102
the output file.  @xref{Changing Files}.
Glenn Morris's avatar
Glenn Morris committed
103 104 105 106 107 108 109

@item file-error
We 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 @code{file-error} is present.  Thus,
the error-strings are not very relevant.  However, these error symbols
do have @code{error-message} properties, and if no data is provided,
110
the @code{error-message} property @emph{is} used.  @xref{Files}.
Glenn Morris's avatar
Glenn Morris committed
111

Glenn Morris's avatar
Glenn Morris committed
112 113 114
@c jka-compr.el
@item compression-error
This is a subcategory of @code{file-error}, which results from
115
problems handling a compressed file.  @xref{How Programs Do Loading}.
Glenn Morris's avatar
Glenn Morris committed
116 117

@c userlock.el
Glenn Morris's avatar
Glenn Morris committed
118
@item file-locked
119
This is a subcategory of @code{file-error}.  @xref{File Locks}.
Glenn Morris's avatar
Glenn Morris committed
120

Glenn Morris's avatar
Glenn Morris committed
121
@c userlock.el
Glenn Morris's avatar
Glenn Morris committed
122
@item file-supersession
123
This is a subcategory of @code{file-error}.  @xref{Modification Time}.
Glenn Morris's avatar
Glenn Morris committed
124

Glenn Morris's avatar
Glenn Morris committed
125
@c net/ange-ftp.el
Glenn Morris's avatar
Glenn Morris committed
126
@item ftp-error
127 128 129
This is a subcategory of @code{file-error}, which results from
problems in accessing a remote file using ftp.  @xref{Remote Files,,,
emacs, The GNU Emacs Manual}.
Glenn Morris's avatar
Glenn Morris committed
130 131

@item invalid-function
132
The message is @samp{Invalid function}.  @xref{Function Indirection}.
Glenn Morris's avatar
Glenn Morris committed
133 134

@item invalid-read-syntax
135 136
The message is @samp{Invalid read syntax}.  @xref{Printed
Representation}.
Glenn Morris's avatar
Glenn Morris committed
137 138

@item invalid-regexp
139
The message is @samp{Invalid regexp}.  @xref{Regular Expressions}.
Glenn Morris's avatar
Glenn Morris committed
140

Glenn Morris's avatar
Glenn Morris committed
141
@c simple.el
Glenn Morris's avatar
Glenn Morris committed
142
@item mark-inactive
143
The message is @samp{The mark is not active now}.  @xref{The Mark}.
Glenn Morris's avatar
Glenn Morris committed
144 145

@item no-catch
146
The message is @samp{No catch for tag}.  @xref{Catch and Throw}.
Glenn Morris's avatar
Glenn Morris committed
147

148
@ignore
Glenn Morris's avatar
Glenn Morris committed
149
@c Not actually used for anything?  Probably definition should be removed.
150
@item protected-field
Paul Eggert's avatar
Paul Eggert committed
151
The message is @samp{Attempt to modify a protected file}.
152 153
@end ignore

Glenn Morris's avatar
Glenn Morris committed
154
@item scan-error
155 156 157
The message is @samp{Scan error}.  This happens when certain
syntax-parsing functions find invalid syntax or mismatched
parentheses.  @xref{List Motion}, and @xref{Parsing Expressions}.
Glenn Morris's avatar
Glenn Morris committed
158 159

@item search-failed
160
The message is @samp{Search failed}.  @xref{Searching and Matching}.
Glenn Morris's avatar
Glenn Morris committed
161 162

@item setting-constant
163 164 165
The message is @samp{Attempt to set a constant symbol}.  This happens
when attempting to assign values to @code{nil}, @code{t}, and keyword
symbols.  @xref{Constant Variables}.
Glenn Morris's avatar
Glenn Morris committed
166

Glenn Morris's avatar
Glenn Morris committed
167
@c simple.el
Glenn Morris's avatar
Glenn Morris committed
168
@item text-read-only
169 170
The message is @samp{Text is read-only}.  This is a subcategory of
@code{buffer-read-only}.  @xref{Special Properties}.
Glenn Morris's avatar
Glenn Morris committed
171 172

@item undefined-color
173
The message is @samp{Undefined color}.  @xref{Color Names}.
Glenn Morris's avatar
Glenn Morris committed
174 175

@item void-function
176
The message is @samp{Symbol's function definition is void}.
Glenn Morris's avatar
Glenn Morris committed
177 178 179
@xref{Function Cells}.

@item void-variable
180
The message is @samp{Symbol's value as variable is void}.
Glenn Morris's avatar
Glenn Morris committed
181 182 183
@xref{Accessing Variables}.

@item wrong-number-of-arguments
184 185
The message is @samp{Wrong number of arguments}.  @xref{Classifying
Lists}.
Glenn Morris's avatar
Glenn Morris committed
186 187

@item wrong-type-argument
188
The message is @samp{Wrong type argument}.  @xref{Type Predicates}.
Glenn Morris's avatar
Glenn Morris committed
189 190
@end table

191
@ignore    The following seem to be unused now.
192
  The following kinds of error, which are classified as special cases of
Glenn Morris's avatar
Glenn Morris committed
193
@code{arith-error}, can occur on certain systems for invalid use of
194
mathematical functions.  @xref{Math Functions}.
Glenn Morris's avatar
Glenn Morris committed
195 196 197

@table @code
@item domain-error
198
The message is @samp{Arithmetic domain error}.
Glenn Morris's avatar
Glenn Morris committed
199 200

@item overflow-error
201 202
The message is @samp{Arithmetic overflow error}.  This is a subcategory
of @code{domain-error}.
Glenn Morris's avatar
Glenn Morris committed
203 204

@item range-error
205
The message is @code{Arithmetic range error}.
Glenn Morris's avatar
Glenn Morris committed
206 207

@item singularity-error
Paul Eggert's avatar
Paul Eggert committed
208
The message is @samp{Arithmetic singularity error}.  This is a
209
subcategory of @code{domain-error}.
Glenn Morris's avatar
Glenn Morris committed
210 211

@item underflow-error
212 213
The message is @samp{Arithmetic underflow error}.  This is a
subcategory of @code{domain-error}.
Glenn Morris's avatar
Glenn Morris committed
214
@end table
215
@end ignore