-
Notifications
You must be signed in to change notification settings - Fork 119
/
xep-0086.xml
347 lines (342 loc) · 9.44 KB
/
xep-0086.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
<header>
<title>Error Condition Mappings</title>
<abstract>A mapping to enable legacy entities to correctly handle errors from XMPP-aware entities.</abstract>
&LEGALNOTICE;
<number>0086</number>
<status>Deprecated</status>
<type>Informational</type>
<sig>Standards</sig>
<dependencies>
<spec>XMPP Core</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>N/A</shortname>
<author>
<firstname>Robert</firstname>
<surname>Norris</surname>
<email>rob@cataclysm.cx</email>
<jid>rob@cataclysm.cx</jid>
</author>
&stpeter;
<revision>
<version>1.0</version>
<date>2004-02-17</date>
<initials>psa</initials>
<remark>Per a vote of the Jabber Council, advanced status to Active.</remark>
</revision>
<revision>
<version>0.7</version>
<date>2003-11-26</date>
<initials>psa</initials>
<remark>Added <not-authorized/> condition.</remark>
</revision>
<revision>
<version>0.6</version>
<date>2003-11-25</date>
<initials>psa</initials>
<remark>Corrected 'type' of <not-acceptable/> error from "cancel" to "modify".</remark>
</revision>
<revision>
<version>0.5</version>
<date>2003-11-17</date>
<initials>psa</initials>
<remark>Fixed a syntax error.</remark>
</revision>
<revision>
<version>0.4</version>
<date>2003-10-30</date>
<initials>psa</initials>
<remark>Added <gone/> XMPP condition.</remark>
</revision>
<revision>
<version>0.3</version>
<date>2003-09-25</date>
<initials>psa</initials>
<remark>Further updated to track XMPP WG output; fixed several errors.</remark>
</revision>
<revision>
<version>0.2</version>
<date>2003-08-13</date>
<initials>psa</initials>
<remark>Updated to track XMPP WG output.</remark>
</revision>
<revision>
<version>0.1</version>
<date>2003-05-21</date>
<initials>rn</initials>
<remark>Initial release.</remark>
</revision>
</header>
<section1 topic='Introduction'>
<p>&xmppcore; documents formats and semantics for stanza error responses. The XML of these errors is different from that of errors that have been traditionally used on the Jabber network.</p>
<p>Until such time that all entities support these new XMPP-style errors, there is a need for entities to issue errors that are understandable by both legacy and XMPP-compliant entities. This document outlines an appropriate mapping to allow this to occur.</p>
<p>This document can also be used by implementers of legacy protocols to determine which XMPP-style error should be used when only a legacy error code is documented.</p>
</section1>
<section1 topic='Supporting Legacy Entities'>
<p>XMPP-compliant entities can issue errors to legacy clients and servers by adding a "code" attribute to the <error/> element it sends.</p>
<example caption='A simple error response'><![CDATA[
<message
to='juliet@capulet.com/balcony'
from='romeo@montague.net/garden'
type='error'>
<body>Wherefore art thou, Romeo?</body>
<error code='404' type='cancel'>
<item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</message>
]]></example>
<p>Legacy entities receiving this error will use the "404" to determine what happened, while XMPP-compliant entities will use the error type and the child element that specifies the condition.</p>
<p>XMPP-compliant entities should add the following error codes to errors if they want them to be understood by legacy entities:</p>
<table caption='Error codes to add to XMPP-style errors'>
<tr>
<th>XMPP error condition</th>
<th>XMPP error type</th>
<th>Legacy error code</th>
</tr>
<tr>
<td><bad-request/></td>
<td>modify</td>
<td>400</td>
</tr>
<tr>
<td><conflict/></td>
<td>cancel</td>
<td>409</td>
</tr>
<tr>
<td><feature-not-implemented/></td>
<td>cancel</td>
<td>501</td>
</tr>
<tr>
<td><forbidden/></td>
<td>auth</td>
<td>403</td>
</tr>
<tr>
<td><gone/></td>
<td>modify</td>
<td>302 (permanent)</td>
</tr>
<tr>
<td><internal-server-error/></td>
<td>wait</td>
<td>500</td>
</tr>
<tr>
<td><item-not-found/></td>
<td>cancel</td>
<td>404</td>
</tr>
<tr>
<td><jid-malformed/></td>
<td>modify</td>
<td>400</td>
</tr>
<tr>
<td><not-acceptable/></td>
<td>modify</td>
<td>406</td>
</tr>
<tr>
<td><not-allowed/></td>
<td>cancel</td>
<td>405</td>
</tr>
<tr>
<td><not-authorized/></td>
<td>auth</td>
<td>401</td>
</tr>
<tr>
<td><payment-required/></td>
<td>auth</td>
<td>402</td>
</tr>
<tr>
<td><recipient-unavailable/></td>
<td>wait</td>
<td>404</td>
</tr>
<tr>
<td><redirect/></td>
<td>modify</td>
<td>302 (temporary)</td>
</tr>
<tr>
<td><registration-required/></td>
<td>auth</td>
<td>407</td>
</tr>
<tr>
<td><remote-server-not-found/></td>
<td>cancel</td>
<td>404</td>
</tr>
<tr>
<td><remote-server-timeout/></td>
<td>wait</td>
<td>504</td>
</tr>
<tr>
<td><resource-constraint/></td>
<td>wait</td>
<td>500</td>
</tr>
<tr>
<td><service-unavailable/></td>
<td>cancel</td>
<td>503</td>
</tr>
<tr>
<td><subscription-required/></td>
<td>auth</td>
<td>407</td>
</tr>
<tr>
<td><undefined-condition/></td>
<td>[any]</td>
<td>500</td>
</tr>
<tr>
<td><unexpected-request/></td>
<td>wait</td>
<td>400</td>
</tr>
</table>
</section1>
<section1 topic='Implementing Legacy Protocols'>
<p>Implementors of legacy protocols should use the appropriate XMPP-style error alongside a legacy error code as specified in the following table:</p>
<table caption='Mapping of legacy error codes to XMPP-style errors'>
<tr>
<th>Legacy error code</th>
<th>Meaning</th>
<th>XMPP error condition</th>
<th>XMPP error type</th>
</tr>
<tr>
<td>302</td>
<td>Redirect</td>
<td><redirect/> (temporary) or <gone/> (permanent)</td>
<td>modify</td>
</tr>
<tr>
<td>400</td>
<td>Bad Request</td>
<td><bad-request/>
<note>See also the <jid-malformed/> and <unexpected-request/> stanza errors.</note>
</td>
<td>modify</td>
</tr>
<tr>
<td>401</td>
<td>Not Authorized</td>
<td><not-authorized/>
<note>See also the <not-authorized/> stream error.</note>
</td>
<td>auth</td>
</tr>
<tr>
<td>402</td>
<td>Payment Required</td>
<td><payment-required/></td>
<td>auth</td>
</tr>
<tr>
<td>403</td>
<td>Forbidden</td>
<td><forbidden/></td>
<td>auth</td>
</tr>
<tr>
<td>404</td>
<td>Not Found</td>
<td><item-not-found/>
<note>See also the <remote-server-not-found/> stanza error.</note>
</td>
<td>cancel</td>
</tr>
<tr>
<td>405</td>
<td>Not Allowed</td>
<td><not-allowed/></td>
<td>cancel</td>
</tr>
<tr>
<td>406</td>
<td>Not Acceptable</td>
<td><not-acceptable/>
<note>See also the <unexpected-request/> stanza error.</note>
</td>
<td>modify</td>
</tr>
<tr>
<td>407</td>
<td>Registration Required</td>
<td><registration-required/></td>
<td>auth</td>
</tr>
<tr>
<td>408</td>
<td>Request Timeout</td>
<td><remote-server-timeout/></td>
<td>wait</td>
</tr>
<tr>
<td>409</td>
<td>Conflict</td>
<td><conflict/></td>
<td>cancel</td>
</tr>
<tr>
<td>500</td>
<td>Internal Server Error</td>
<td><internal-server-error/>
<note>See also the <undefined-condition/> stanza error.</note>
</td>
<td>wait</td>
</tr>
<tr>
<td>501</td>
<td>Not Implemented</td>
<td><feature-not-implemented/></td>
<td>cancel</td>
</tr>
<tr>
<td>502</td>
<td>Remote Server Error</td>
<td><service-unavailable/></td>
<td>wait</td>
</tr>
<tr>
<td>503</td>
<td>Service Unavailable</td>
<td><service-unavailable/></td>
<td>cancel</td>
</tr>
<tr>
<td>504</td>
<td>Remote Server Timeout</td>
<td><remote-server-timeout/></td>
<td>wait</td>
</tr>
<tr>
<td>510</td>
<td>Disconnected</td>
<td><service-unavailable/></td>
<td>cancel</td>
</tr>
</table>
</section1>
<section1 topic='Conclusion'>
<p>Mapping legacy error codes to XMPP-style errors is an inexact science, and there are likely to be inconsistencies in some places. However, it is the authors' belief that the mapping presented in this document will be adequate for the majority of cases, and will help smooth the migration to XMPP-compliant implementations.</p>
</section1>
</xep>