errors
— Exception classes¶
Exception classes mapping to XMPP stream errors¶
-
class
aioxmpp.errors.
StreamErrorCondition
(value)[source]¶ Enumeration to represent a RFC 6120 stream error condition. Please see RFC 6120, section 4.9.3, for the semantics of the individual conditions.
New in version 0.10.
-
BAD_FORMAT
= (namespaces.streams, "bad-format")¶
-
BAD_NAMESPACE_PREFIX
= (namespaces.streams, "bad-namespace-prefix")¶
-
CONFLICT
= (namespaces.streams, "conflict")¶
-
CONNECTION_TIMEOUT
= (namespaces.streams, "connection-timeout")¶
-
HOST_GONE
= (namespaces.streams, "host-gone")¶
-
HOST_UNKNOWN
= (namespaces.streams, "host-unknown")¶
-
IMPROPER_ADDRESSING
= (namespaces.streams, "improper-addressing")¶
-
INTERNAL_SERVER_ERROR
= (namespaces.streams, "internal-server-error")¶
-
INVALID_FROM
= (namespaces.streams, "invalid-from")¶
-
INVALID_NAMESPACE
= (namespaces.streams, "invalid-namespace")¶
-
INVALID_XML
= (namespaces.streams, "invalid-xml")¶
-
NOT_AUTHORIZED
= (namespaces.streams, "not-authorized")¶
-
NOT_WELL_FORMED
= (namespaces.streams, "not-well-formed")¶
-
POLICY_VIOLATION
= (namespaces.streams, "policy-violation")¶
-
REMOTE_CONNECTION_FAILED
= (namespaces.streams, "remote-connection-failed")¶
-
RESET
= (namespaces.streams, "reset")¶
-
RESOURCE_CONSTRAINT
= (namespaces.streams, "resource-constraint")¶
-
RESTRICTED_XML
= (namespaces.streams, "restricted-xml")¶
-
SEE_OTHER_HOST
= (namespaces.streams, "see-other-host")¶
-
SYSTEM_SHUTDOWN
= (namespaces.streams, "system-shutdown")¶
-
UNDEFINED_CONDITION
= (namespaces.streams, "undefined-condition")¶
-
UNSUPPORTED_ENCODING
= (namespaces.streams, "unsupported-encoding")¶
-
UNSUPPORTED_FEATURE
= (namespaces.streams, "unsupported-feature")¶
-
UNSUPPORTED_STANZA_TYPE
= (namespaces.streams, "unsupported-stanza-type")¶
-
UNSUPPORTED_VERSION
= (namespaces.streams, "unsupported-version")¶
-
Exception classes mapping to XMPP stanza errors¶
-
class
aioxmpp.errors.
XMPPError
(condition, text=None, application_defined_condition=None)[source]¶ Exception representing an error defined in the XMPP protocol.
- Parameters
condition (
aioxmpp.ErrorCondition
oraioxmpp.xso.XSO
) – The RFC 6120 defined error condition as enumeration member oraioxmpp.xso.XSO
text (
str
) – Optional human-readable text explaining the errorapplication_defined_condition (
aioxmpp.xso.XSO
) – Object describing the error in more detail
Changed in version 0.10: As of 0.10, condition should either be a
aioxmpp.ErrorCondition
enumeration member or an XSO representing one of the error conditions.For compatibility, namespace-localpart tuples indicating the tag of the defined error condition are still accepted.
Deprecated since version 0.10: Starting with aioxmpp 1.0, namespace-localpart tuples will not be accepted anymore. See the changelog for notes on the transition.
-
condition_obj
¶ The
aioxmpp.XSO
which represents the error condition.New in version 0.10.
-
condition
¶ aioxmpp.ErrorCondition
enumeration member representing the error condition.
-
text
¶ Optional human-readable text describing the error further.
This is
None
if the text is omitted.
-
application_defined_condition
¶ Optional
aioxmpp.XSO
which further defines the error condition.
Relevant subclasses:
aioxmpp.XMPPAuthError
(condition[, text, …])aioxmpp.XMPPModifyError
(condition[, text, …])aioxmpp.XMPPCancelError
(condition[, text, …])aioxmpp.XMPPContinueError
(condition[, text, …])aioxmpp.XMPPWaitError
(condition[, text, …])
-
class
aioxmpp.
ErrorCondition
(value)[source]¶ Enumeration to represent a RFC 6120 stanza error condition. Please see RFC 6120, section 8.3.3, for the semantics of the individual conditions.
New in version 0.10.
-
BAD_REQUEST
= namespaces.stanzas, "bad-request"¶
-
CONFLICT
= namespaces.stanzas, "conflict"¶
-
FEATURE_NOT_IMPLEMENTED
= namespaces.stanzas, "feature-not-implemented"¶
-
FORBIDDEN
= namespaces.stanzas, "forbidden"¶
-
GONE
= namespaces.stanzas, "gone"¶
-
INTERNAL_SERVER_ERROR
= namespaces.stanzas, "internal-server-error"¶
-
ITEM_NOT_FOUND
= namespaces.stanzas, "item-not-found"¶
-
JID_MALFORMED
= namespaces.stanzas, "jid-malformed"¶
-
NOT_ACCEPTABLE
= namespaces.stanzas, "not-acceptable"¶
-
NOT_ALLOWED
= namespaces.stanzas, "not-allowed"¶
-
NOT_AUTHORIZED
= namespaces.stanzas, "not-authorized"¶
-
POLICY_VIOLATION
= namespaces.stanzas, "policy-violation"¶
-
RECIPIENT_UNAVAILABLE
= namespaces.stanzas, "recipient-unavailable"¶
-
REDIRECT
= namespaces.stanzas, "redirect"¶
-
REGISTRATION_REQUIRED
= namespaces.stanzas, "registration-required"¶
-
REMOTE_SERVER_NOT_FOUND
= namespaces.stanzas, "remote-server-not-found"¶
-
REMOTE_SERVER_TIMEOUT
= namespaces.stanzas, "remote-server-timeout"¶
-
RESOURCE_CONSTRAINT
= namespaces.stanzas, "resource-constraint"¶
-
SERVICE_UNAVAILABLE
= namespaces.stanzas, "service-unavailable"¶
-
SUBSCRIPTION_REQUIRED
= namespaces.stanzas, "subscription-required"¶
-
UNDEFINED_CONDITION
= namespaces.stanzas, "undefined-condition"¶
-
UNEXPECTED_REQUEST
= namespaces.stanzas, "unexpected-request"¶
-
-
class
aioxmpp.errors.
ErroneousStanza
(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).
Stream negotiation exceptions¶
-
class
aioxmpp.errors.
SecurityNegotiationFailure
(xmpp_error, kind='Security negotiation failure', 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 toLocalizableString.localize
when eitherstr()
is called on theUserError
orlocalize()
is called.The
str()
is created using the defaultLocalizingFormatter
and agettext.NullTranslations
instance. The point in time at which the default localizing formatter is created is unspecified.
-
class
aioxmpp.errors.
UserValueError
(localizable_string, *args, **kwargs)[source]¶ This is a
ValueError
withUserError
mixed in.