Package pyxmpp :: Module error :: Class StanzaErrorNode

[hide private]

# Class StanzaErrorNode

source code

    ErrorNode --+
                |
               StanzaErrorNode

Stanza error element.

Instance Methods | [hide private]

__init__(self, xmlnode_or_cond, error_type=None, copy=1, parent=None) Initialize a StreamErrorNode object. | source code

`unicode`

get_type(self) Get the error type. | source code

upgrade(self) Upgrade a legacy error element to the XMPP compliant one. | source code

`unicode`

get_message(self) Get the message for the error. | source code

Inherited from `ErrorNode`: `__del__`, `add_custom_condition`, `downgrade`, `free`, `free_borrowed`, `get_condition`, `get_text`, `is_legacy`, `serialize`, `xpath_eval`

Method Details | [hide private]

### __init__(self, xmlnode_or_cond, error_type=None, copy=1, parent=None)
(Constructor)

source code

Initialize a StreamErrorNode object.

Parameters:
  - `xmlnode_or_cond` (: `libxml2.xmlNode` or `unicode`) - : XML node to be wrapped into this object or the primary (defined by XMPP specification) error condition name.
  - `error_type` (: `unicode`) - : type of the error, one of: 'cancel', 'continue', 'modify', 'auth', 'wait'.
  - `copy` (: `bool`) - : When `True` then the XML node will be copied, otherwise it is only borrowed.
  - `parent` (: `libxml2.xmlNode`) - : Parent node for the XML node to be copied or created.
Overrides: ErrorNode.__init__

### get_type(self)

source code

Get the error type.

Returns: `unicode`
  type of the error.

### upgrade(self)

source code

Upgrade a legacy error element to the XMPP compliant one.

Use the error code provided to select the condition and the <error/> CDATA for the error text.

Overrides: ErrorNode.upgrade

### get_message(self)

source code

Get the message for the error.

Returns: `unicode`
  the error message.