mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-14 11:33:14 +00:00
Add xoap error handler to weather-forecast too
This commit is contained in:
parent
e16511be02
commit
0cd29676c0
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user