%ents; ]>
Error Condition Mappings A mapping to enable legacy entities to correctly handle errors from XMPP-aware entities. &LEGALNOTICE; 0086 Deprecated Informational Standards XMPP Core N/A Robert Norris rob@cataclysm.cx rob@cataclysm.cx &stpeter; 1.0 2004-02-17 psa Per a vote of the Jabber Council, advanced status to Active. 0.7 2003-11-26 psa Added <not-authorized/> condition. 0.6 2003-11-25 psa Corrected 'type' of <not-acceptable/> error from "cancel" to "modify". 0.5 2003-11-17 psa Fixed a syntax error. 0.4 2003-10-30 psa Added <gone/> XMPP condition. 0.3 2003-09-25 psa Further updated to track XMPP WG output; fixed several errors. 0.2 2003-08-13 psa Updated to track XMPP WG output. 0.1 2003-05-21 rn Initial release.

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

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.

Wherefore art thou, Romeo? ]]>

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:

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:

Legacy error code Meaning XMPP error condition XMPP error type
302 Redirect <redirect/> (temporary) or <gone/> (permanent) modify
400 Bad Request <bad-request/> See also the <jid-malformed/> and <unexpected-request/> stanza errors. modify
401 Not Authorized <not-authorized/> See also the <not-authorized/> stream error. auth
402 Payment Required <payment-required/> auth
403 Forbidden <forbidden/> auth
404 Not Found <item-not-found/> See also the <remote-server-not-found/> stanza error. cancel
405 Not Allowed <not-allowed/> cancel
406 Not Acceptable <not-acceptable/> See also the <unexpected-request/> stanza error. 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/> See also the <undefined-condition/> stanza error. 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.