1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-09-30 05:59:07 +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; char *content;
xmlXPathObjectPtr xpathObj; 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++) { for (i = 0; i < NUM_XPATH_EXPRESSIONS_DF; i++) {
xpathObj = xmlXPathEvalExpression((const xmlChar *)xpath_expression_df[i], xpathCtx); xpathObj = xmlXPathEvalExpression((const xmlChar *)xpath_expression_df[i], xpathCtx);
if (xpathObj != NULL) { if (xpathObj != NULL) {