Merge from emacs-24; up to 2012-04-21T14:12:27Z!sdl.web@gmail.com
[bpt/emacs.git] / doc / lispref / errors.texi
CommitLineData
b8d4c8d0
GM
1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual.
4bb82fa8 3@c Copyright (C) 1990-1993, 1999, 2001-2012 Free Software Foundation, Inc.
b8d4c8d0 4@c See the file elisp.texi for copying conditions.
29157371 5@node Standard Errors, Standard Keymaps, GNU Emacs Internals, Top
b8d4c8d0
GM
6@appendix Standard Errors
7@cindex standard errors
8
7e05b1ec 9 Here is a list of the more important error symbols in standard Emacs,
b8d4c8d0
GM
10grouped by concept. The list includes each symbol's message (on the
11@code{error-message} property of the symbol) and a cross reference to a
12description of how the error can occur.
13
14 Each error symbol has an @code{error-conditions} property that is a
15list of symbols. Normally this list includes the error symbol itself
16and the symbol @code{error}. Occasionally it includes additional
17symbols, which are intermediate classifications, narrower than
18@code{error} but broader than a single error symbol. For example, all
19the errors in accessing files have the condition @code{file-error}. If
20we do not say here that a certain error symbol has additional error
21conditions, that means it has none.
22
23 As a special exception, the error symbol @code{quit} does not have the
24condition @code{error}, because quitting is not considered an error.
25
7e05b1ec
GM
26@c You can grep for "(put 'foo 'error-conditions ...) to find
27@c examples defined in Lisp. Eg soap-client.el, sasl.el.
28 Most of these error symbols are defined in C (mainly @file{data.c}),
29but some are defined in Lisp. For example, the file @file{userlock.el}
30defines the @code{file-locked} and @code{file-supersession} errors.
31Several of the specialized Lisp libraries distributed with Emacs
32define their own error symbols. We do not attempt to list of all
33those here.
34
b8d4c8d0
GM
35 @xref{Errors}, for an explanation of how errors are generated and
36handled.
37
38@table @code
b8d4c8d0
GM
39@item error
40@code{"error"}@*
41@xref{Errors}.
42
43@item quit
44@code{"Quit"}@*
45@xref{Quitting}.
46
47@item args-out-of-range
48@code{"Args out of range"}@*
49This happens when trying to access an element beyond the range of a
50sequence or buffer.@*
51@xref{Sequences Arrays Vectors}, @xref{Text}.
52
53@item arith-error
54@code{"Arithmetic error"}@*
55@xref{Arithmetic Operations}.
56
57@item beginning-of-buffer
58@code{"Beginning of buffer"}@*
59@xref{Character Motion}.
60
61@item buffer-read-only
62@code{"Buffer is read-only"}@*
63@xref{Read Only Buffers}.
64
4bb82fa8
GM
65@item circular-list
66@code{"List contains a loop"}@*
7e05b1ec
GM
67This happens when some operations (e.g. resolving face names)
68encounter circular structures.@*
69@xref{Circular Objects}.
70
71@item cl-assertion-failed
72@code{"Assertion failed"}@*
73This happens when the @code{assert} macro fails a test.@*
74@xref{Assertions,,, cl, Common Lisp Extensions}.
4bb82fa8 75
b8d4c8d0
GM
76@item coding-system-error
77@code{"Invalid coding system"}@*
78@xref{Lisp and Coding Systems}.
79
80@item cyclic-function-indirection
5338dc0b 81@code{"Symbol's chain of function indirections contains a loop"}@*
b8d4c8d0
GM
82@xref{Function Indirection}.
83
84@item cyclic-variable-indirection
5338dc0b 85@code{"Symbol's chain of variable indirections contains a loop"}@*
b8d4c8d0
GM
86@xref{Variable Aliases}.
87
4bb82fa8
GM
88@item dbus-error
89@code{"D-Bus error"}@*
90This is only defined if Emacs was compiled with D-Bus support.@*
91@xref{Errors and Events,,, dbus, D-Bus integration in Emacs}.
92
b8d4c8d0
GM
93@item end-of-buffer
94@code{"End of buffer"}@*
95@xref{Character Motion}.
96
97@item end-of-file
98@code{"End of file during parsing"}@*
99Note that this is not a subcategory of @code{file-error},
100because it pertains to the Lisp reader, not to file I/O.@*
101@xref{Input Functions}.
102
103@item file-already-exists
104This is a subcategory of @code{file-error}.@*
105@xref{Writing to Files}.
106
107@item file-date-error
108This is a subcategory of @code{file-error}. It occurs when
109@code{copy-file} tries and fails to set the last-modification time of
110the output file.@*
111@xref{Changing Files}.
112
113@item file-error
114We do not list the error-strings of this error and its subcategories,
115because the error message is normally constructed from the data items
116alone when the error condition @code{file-error} is present. Thus,
117the error-strings are not very relevant. However, these error symbols
118do have @code{error-message} properties, and if no data is provided,
119the @code{error-message} property @emph{is} used.@*
120@xref{Files}.
121
7e05b1ec
GM
122@c jka-compr.el
123@item compression-error
124This is a subcategory of @code{file-error}, which results from
125problems handling a compressed file.@*
126@xref{How Programs Do Loading}.
127
128@c userlock.el
b8d4c8d0
GM
129@item file-locked
130This is a subcategory of @code{file-error}.@*
131@xref{File Locks}.
132
7e05b1ec 133@c userlock.el
b8d4c8d0
GM
134@item file-supersession
135This is a subcategory of @code{file-error}.@*
136@xref{Modification Time}.
137
7e05b1ec 138@c net/ange-ftp.el
b8d4c8d0
GM
139@item ftp-error
140This is a subcategory of @code{file-error}, which results from problems
141in accessing a remote file using ftp.@*
142@xref{Remote Files,,, emacs, The GNU Emacs Manual}.
143
144@item invalid-function
145@code{"Invalid function"}@*
146@xref{Function Indirection}.
147
148@item invalid-read-syntax
149@code{"Invalid read syntax"}@*
150@xref{Printed Representation}.
151
152@item invalid-regexp
153@code{"Invalid regexp"}@*
154@xref{Regular Expressions}.
155
7e05b1ec 156@c simple.el
b8d4c8d0
GM
157@item mark-inactive
158@code{"The mark is not active now"}@*
159@xref{The Mark}.
160
161@item no-catch
162@code{"No catch for tag"}@*
163@xref{Catch and Throw}.
164
4bb82fa8 165@ignore
7e05b1ec 166@c Not actually used for anything? Probably definition should be removed.
4bb82fa8
GM
167@item protected-field
168@code{"Attempt to modify a protected field"}
169@end ignore
170
b8d4c8d0
GM
171@item scan-error
172@code{"Scan error"}@*
173This happens when certain syntax-parsing functions
174find invalid syntax or mismatched parentheses.@*
175@xref{List Motion}, and @ref{Parsing Expressions}.
176
177@item search-failed
178@code{"Search failed"}@*
179@xref{Searching and Matching}.
180
181@item setting-constant
182@code{"Attempt to set a constant symbol"}@*
183The values of the symbols @code{nil} and @code{t},
184and any symbols that start with @samp{:},
185may not be changed.@*
186@xref{Constant Variables, , Variables that Never Change}.
187
7e05b1ec 188@c simple.el
b8d4c8d0
GM
189@item text-read-only
190@code{"Text is read-only"}@*
191This is a subcategory of @code{buffer-read-only}.@*
192@xref{Special Properties}.
193
194@item undefined-color
195@code{"Undefined color"}@*
196@xref{Color Names}.
197
198@item void-function
199@code{"Symbol's function definition is void"}@*
200@xref{Function Cells}.
201
202@item void-variable
203@code{"Symbol's value as variable is void"}@*
204@xref{Accessing Variables}.
205
206@item wrong-number-of-arguments
207@code{"Wrong number of arguments"}@*
208@xref{Classifying Lists}.
209
210@item wrong-type-argument
211@code{"Wrong type argument"}@*
212@xref{Type Predicates}.
213@end table
214
4bb82fa8 215 The following kinds of error, which are classified as special cases of
b8d4c8d0 216@code{arith-error}, can occur on certain systems for invalid use of
4bb82fa8 217mathematical functions. @xref{Math Functions}.
b8d4c8d0
GM
218
219@table @code
220@item domain-error
4bb82fa8 221@code{"Arithmetic domain error"}
b8d4c8d0
GM
222
223@item overflow-error
224@code{"Arithmetic overflow error"}@*
4bb82fa8 225This is a subcategory of @code{domain-error}.
b8d4c8d0
GM
226
227@item range-error
4bb82fa8 228@code{"Arithmetic range error"}
b8d4c8d0
GM
229
230@item singularity-error
231@code{"Arithmetic singularity error"}@*
4bb82fa8 232This is a subcategory of @code{domain-error}.
b8d4c8d0
GM
233
234@item underflow-error
235@code{"Arithmetic underflow error"}@*
4bb82fa8 236This is a subcategory of @code{domain-error}.
b8d4c8d0 237@end table