| Abstract: | A mapping to enable legacy entities to correctly handle errors from XMPP-aware entities. |
| Authors: | Robert Norris, Peter Saint-Andre |
| Copyright: | © 1999 - 2010 XMPP Standards Foundation. SEE LEGAL NOTICES. |
| Status: | Deprecated |
| Type: | Informational |
| Version: | 1.0 |
| Last Updated: | 2004-02-17 |
WARNING: This document has been Deprecated by the XMPP Standards Foundation. Implementation of the protocol described herein is not recommended. Developers desiring similar functionality are advised to implement the protocol that supersedes this one (if any).
1. Introduction
2. Supporting Legacy Entities
3. Implementing Legacy Protocols
4. Conclusion
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
XMPP Core [1] 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.
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.
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.
XMPP-compliant entities can issue errors to legacy clients and servers by adding a "code" attribute to the <error/> element it sends.
Example 1. A simple error response
<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>
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.
XMPP-compliant entities should add the following error codes to errors if they want them to be understood by legacy entities:
Table 1: Error codes to add to XMPP-style errors
| XMPP error condition | XMPP error type | Legacy error code |
|---|---|---|
| <bad-request/> | modify | 400 |
| <conflict/> | cancel | 409 |
| <feature-not-implemented/> | cancel | 501 |
| <forbidden/> | auth | 403 |
| <gone/> | modify | 302 (permanent) |
| <internal-server-error/> | wait | 500 |
| <item-not-found/> | cancel | 404 |
| <jid-malformed/> | modify | 400 |
| <not-acceptable/> | modify | 406 |
| <not-allowed/> | cancel | 405 |
| <not-authorized/> | auth | 401 |
| <payment-required/> | auth | 402 |
| <recipient-unavailable/> | wait | 404 |
| <redirect/> | modify | 302 (temporary) |
| <registration-required/> | auth | 407 |
| <remote-server-not-found/> | cancel | 404 |
| <remote-server-timeout/> | wait | 504 |
| <resource-constraint/> | wait | 500 |
| <service-unavailable/> | cancel | 503 |
| <subscription-required/> | auth | 407 |
| <undefined-condition/> | [any] | 500 |
| <unexpected-request/> | wait | 400 |
Implementors of legacy protocols should use the appropriate XMPP-style error alongside a legacy error code as specified in the following table:
Table 2: Mapping of legacy error codes to XMPP-style errors
| Legacy error code | Meaning | XMPP error condition | XMPP error type |
|---|---|---|---|
| 302 | Redirect | <redirect/> (temporary) or <gone/> (permanent) | modify |
| 400 | Bad Request | <bad-request/> [2] | modify |
| 401 | Not Authorized | <not-authorized/> [3] | auth |
| 402 | Payment Required | <payment-required/> | auth |
| 403 | Forbidden | <forbidden/> | auth |
| 404 | Not Found | <item-not-found/> [4] | cancel |
| 405 | Not Allowed | <not-allowed/> | cancel |
| 406 | Not Acceptable | <not-acceptable/> [5] | modify |
| 407 | Registration Required | <registration-required/> | auth |
| 408 | Request Timeout | <remote-server-timeout/> | wait |
| 409 | Conflict | <conflict/> | cancel |
| 500 | Internal Server Error | <internal-server-error/> [6] | wait |
| 501 | Not Implemented | <feature-not-implemented/> | cancel |
| 502 | Remote Server Error | <service-unavailable/> | wait |
| 503 | Service Unavailable | <service-unavailable/> | cancel |
| 504 | Remote Server Timeout | <remote-server-timeout/> | wait |
| 510 | Disconnected | <service-unavailable/> | cancel |
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.
Series: XEP
Number: 0086
Publisher: XMPP Standards Foundation
Status:
Deprecated
Type:
Informational
Version: 1.0
Last Updated: 2004-02-17
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: None
Short Name: N/A
Source Control:
HTML
RSS
This document in other formats:
XML
PDF
Email:
rob@cataclysm.cx
JabberID:
rob@cataclysm.cx
Email:
stpeter@jabber.org
JabberID:
stpeter@jabber.org
URI:
https://stpeter.im/
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. RFC 3920: Extensible Messaging and Presence Protocol (XMPP): Core <http://tools.ietf.org/html/rfc3920>.
2. See also the <jid-malformed/> and <unexpected-request/> stanza errors.
3. See also the <not-authorized/> stream error.
4. See also the <remote-server-not-found/> stanza error.
5. See also the <unexpected-request/> stanza error.
6. See also the <undefined-condition/> stanza error.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
END