1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-05 21:07:52 +00:00

Add xoap error handler to weather-forecast too

This commit is contained in:
Cesare Tirabassi 2009-08-05 17:50:24 +02:00
parent e16511be02
commit 0cd29676c0

View File

@ -108,6 +108,17 @@ static void parse_df(PWEATHER_FORECAST *res, xmlXPathContextPtr xpathCtx)
char *content;
xmlXPathObjectPtr xpathObj;
xpathObj = xmlXPathEvalExpression((const xmlChar *)"/error/err", xpathCtx);
if (xpathObj && xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0 &&
xpathObj->nodesetval->nodeTab[0]->type == XML_ELEMENT_NODE) {
content = (char *)xmlNodeGetContent(xpathObj->nodesetval->nodeTab[0]);
NORM_ERR("XOAP error: %s", content);
xmlFree(content);
xmlXPathFreeObject(xpathObj);
return;
}
xmlXPathFreeObject(xpathObj);
for (i = 0; i < NUM_XPATH_EXPRESSIONS_DF; i++) {
xpathObj = xmlXPathEvalExpression((const xmlChar *)xpath_expression_df[i], xpathCtx);
if (xpathObj != NULL) {