errors — Exception classes

Exception classes mapping to XMPP stream errors

class aioxmpp.errors.StreamError(condition, text=None)[source]

Exception classes mapping to XMPP stanza errors

class aioxmpp.errors.StanzaError[source]
class aioxmpp.errors.XMPPError(condition, text=None, application_defined_condition=None)[source]
class aioxmpp.errors.XMPPAuthError(condition, text=None, application_defined_condition=None)[source]
class aioxmpp.errors.XMPPModifyError(condition, text=None, application_defined_condition=None)[source]
class aioxmpp.errors.XMPPCancelError(condition, text=None, application_defined_condition=None)[source]
class aioxmpp.errors.XMPPWaitError(condition, text=None, application_defined_condition=None)[source]
class aioxmpp.errors.XMPPContinueError(condition, text=None, application_defined_condition=None)[source]
class aioxmpp.errors.ErrorneousStanza(partial_obj)[source]

This exception is thrown into listeners for IQ responses by aioxmpp.stream.StanzaStream if a response for an IQ was received, but could not be decoded (due to malformed or unsupported payload).

partial_obj

Contains the partially decoded stanza XSO. Do not rely on any members except those representing XML attributes (to, from_, type_).

Stream negotiation exceptions

class aioxmpp.errors.StreamNegotiationFailure[source]
class aioxmpp.errors.SecurityNegotiationFailure(xmpp_error, kind='Security negotiation failure', text=None)[source]
class aioxmpp.errors.SASLFailure(xmpp_error, text=None)[source]
class aioxmpp.errors.SASLUnavailable(xmpp_error, text=None)[source]
class aioxmpp.errors.TLSFailure(xmpp_error, text=None)[source]
class aioxmpp.errors.TLSUnavailable(xmpp_error, text=None)[source]
class aioxmpp.errors.AuthenticationFailure(xmpp_error, text=None)[source]

I18N exceptions

class aioxmpp.errors.UserError(localizable_string, *args, **kwargs)[source]

An exception subclass, which should be used as a mix-in.

It is intended to be used for exceptions which may be user-facing, such as connection errors, value validation issues and the like.

localizable_string must be a i18n.LocalizableString instance. The args and kwargs will be passed to LocalizableString.localize when either str() is called on the UserError or localize() is called.

The str() is created using the default LocalizingFormatter and a gettext.NullTranslations instance. The point in time at which the default localizing formatter is created is unspecified.

localize(formatter, translator)[source]

Return a localized version of the localizable_string passed to the consturctor. It is formatted using the formatter with the args and kwargs passed to the constructor of UserError.

class aioxmpp.errors.UserValueError(localizable_string, *args, **kwargs)[source]

This is a ValueError with UserError mixed in.

Other exceptions

class aioxmpp.errors.MultiOSError(message, exceptions)[source]

Describe an error situation which has been caused by the sequential occurence of multiple other exceptions.

The message shall be descriptive and will be prepended to a concatenation of the error messages of the given exceptions.