'Set the error code. Obsolette. Use error-conditions instead.'

def setError(self, error, code=None):

    if code:
        if (str(code) in _errorcodes.keys()):
            error = ErrorNode(_errorcodes[str(code)], text=error)
        else:
            error = ErrorNode(ERR_UNDEFINED_CONDITION, code=code, typ='cancel', text=error)
    elif (type(error) in [type(''), type(u'')]):
        error = ErrorNode(error)
    self.setType('error')
    self.addChild(node=error)
