def getExceptionIfError(self, resultNode): errorNode = resultNode.find('error') if errorNode is None: return None messageNode = errorNode.find('message') codeNode = errorNode.find('code') if messageNode is None or codeNode is None: return None return KalturaException(getXmlNodeText(messageNode), getXmlNodeText(codeNode))
def getExceptionIfError(self, resultNode): errorNode = resultNode.find('error') if errorNode is None: return None messageNode = errorNode.find('message') codeNode = errorNode.find('code') if messageNode is None or codeNode is None: return None return KalturaException( getXmlNodeText(messageNode), getXmlNodeText(codeNode))
def doMultiRequest(self): resultXml = self.doQueue() if resultXml is None: return [] result = [] for i, childNode in enumerate(resultXml.getchildren()): exceptionObj = self.getExceptionIfError(childNode) if exceptionObj is not None: result.append(exceptionObj) elif childNode.find('objectType') is not None: result.append( KalturaObjectFactory.create( childNode, self.multiRequestReturnType[i])) elif childNode.find('item/objectType') is not None: result.append( KalturaObjectFactory.createArray( childNode, self.multiRequestReturnType[i])) else: result.append(getXmlNodeText(childNode)) self.multiRequestReturnType = None return result