Skip to content
Back to top
View this page

# Exceptions

exception slixmpp.exceptions.XMPPError(condition='undefined-condition', text='', etype=None, extension=None, extension_ns=None, extension_args=None, clear=True, by=None)

  A generic exception that may be raised while processing an XMPP stanza to indicate that an error response stanza should be sent.

  The exception method for stanza objects extending `RootStanza` will create an error stanza and initialize any additional substanzas using the extension information included in the exception.

  Meant for use in Slixmpp plugins and applications using Slixmpp.

  Extension information can be included to add additional XML elements to the generated error stanza.

  Parameters:

    - condition (`Literal`[`'bad-request'`, `'conflict'`, `'feature-not-implemented'`, `'forbidden'`, `'gone'`, `'internal-server-error'`, `'item-not-found'`, `'jid-malformed'`, `'not-acceptable'`, `'not-allowed'`, `'not-authorized'`, `'payment-required'`, `'policy-violation'`, `'recipient-unavailable'`, `'redirect'`, `'registration-required'`, `'remote-server-not-found'`, `'remote-server-timeout'`, `'resource-constraint'`, `'service-unavailable'`, `'subscription-required'`, `'undefined-condition'`, `'unexpected-request'`]) – The XMPP defined error condition. Defaults to `'undefined-condition'`.

    - text – Human readable text describing the error.

    - etype (`Literal`[`'modify'`, `'cancel'`, `'auth'`, `'wait'`] | `None`) – The XMPP error type, such as `'cancel'` or `'modify'`. Defaults to `'cancel'`.

    - extension – Tag name of the extension’s XML content.

    - extension_ns – XML namespace of the extensions’ XML content.

    - extension_args – Content and attributes for the extension element. Same as the additional arguments to the `Element` constructor.

    - clear – Indicates if the stanza’s contents should be removed before replying with an error. Defaults to `True`.

  format()

    Format the error in a simple user-readable string.

exception slixmpp.exceptions.IqError(iq)

  An exception raised when an Iq stanza of type ‘error’ is received after making a blocking send call.

  iq

    The `Iq` error result stanza.

exception slixmpp.exceptions.IqTimeout(iq)

  An exception which indicates that an IQ request response has not been received within the allotted time window.

  iq

    The `Iq` stanza whose response did not arrive before the timeout expired.