t.w.p.j.e.StanzaError(BaseError) : class documentation

Part of twisted.words.protocols.jabber.error View Source View In Hierarchy

Stanza Error exception.

Refer to RFC 3920, section 9.3, for the allowed values for condition and type.
Instance VariablestypeThe stanza error type. Gives a suggestion to the recipient of the error on how to proceed. (type: str )
codeA numeric identifier for the error condition for backwards compatibility with pre-XMPP Jabber implementations.
Method __init__ Undocumented
Method getElement Get XML representation from self.
Method toResponse Construct error response stanza.

Inherited from BaseError:

Method __str__ Undocumented
def __init__(self, condition, type=None, text=None, textLang=None, appCondition=None): (source)
Undocumented
def getElement(self): (source)

Get XML representation from self.

Overrides the base BaseError.getElement to make sure the returned element has a type attribute and optionally a legacy code attribute.
Returns (type: domish.Element )
def toResponse(self, stanza): (source)

Construct error response stanza.

The stanza is transformed into an error response stanza by swapping the to and from addresses and inserting an error element.
Parametersstanzathe stanza to respond to (type: domish.Element )
Note

This creates a shallow copy of the list of child elements of the stanza. The child elements themselves are not copied themselves, and references to their parent element will still point to the original stanza element.

The serialization of an element does not use the reference to its parent, so the typical use case of immediately sending out the constructed error response is not affected.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:27:37.