XEP-0086: Error Condition Mappings

Abstract
A mapping to enable legacy entities to correctly handle errors from XMPP-aware entities.
Authors
  • Robert Norris
  • Peter Saint-Andre
Copyright
© 1999 – 2020 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status

Deprecated

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).
Type
Informational
Version
1.0 (2004-02-17)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Active
  4. Deprecated
  5. Obsolete

1. Introduction

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.

2. Supporting Legacy Entities

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

3. Implementing Legacy Protocols

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

4. Conclusion

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.


Appendices

Appendix A: Document Information

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

This document in other formats: XML  PDF

Appendix B: Author Information

Robert Norris
Email
rob@cataclysm.cx
JabberID
rob@cataclysm.cx
Peter Saint-Andre
Email
xsf@stpeter.im
JabberID
peter@jabber.org
URI
http://stpeter.im/

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2020 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Visual Presentation

The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) 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.

Appendix E: Discussion Venue

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>.

Appendix F: Requirements Conformance

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".

Appendix G: Notes

1. RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core <http://tools.ietf.org/html/rfc6120>.

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.

Appendix H: Revision History

Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/

  1. Version 1.0 (2004-02-17)
    Per a vote of the Jabber Council, advanced status to Active.
    psa
  2. Version 0.7 (2003-11-26)
    Added <not-authorized/> condition.
    psa
  3. Version 0.6 (2003-11-25)
    Corrected 'type' of <not-acceptable/> error from "cancel" to "modify".
    psa
  4. Version 0.5 (2003-11-17)
    Fixed a syntax error.
    psa
  5. Version 0.4 (2003-10-30)
    Added <gone/> XMPP condition.
    psa
  6. Version 0.3 (2003-09-25)
    Further updated to track XMPP WG output; fixed several errors.
    psa
  7. Version 0.2 (2003-08-13)
    Updated to track XMPP WG output.
    psa
  8. Version 0.1 (2003-05-21)
    Initial release.
    rn

END