Fix error messages in AgChart’s get_by_xpath()

This commit is contained in:
Gergely Polonkai 2014-07-17 23:08:34 +02:00
parent 183c0a00dc
commit 5671a751a9

View File

@ -446,8 +446,9 @@ get_by_xpath(xmlXPathContextPtr xpath_context,
g_set_error( g_set_error(
err, err,
AG_CHART_ERROR, AG_CHART_ERROR_CORRUPT_FILE, AG_CHART_ERROR, AG_CHART_ERROR_CORRUPT_FILE,
"File '%s' doesn't look like a valid saved chart.", "File '%s' doesn't look like a valid saved chart: "
uri "missing node: %s",
uri, xpath
); );
xmlXPathFreeObject(xpathObj); xmlXPathFreeObject(xpathObj);
@ -459,8 +460,9 @@ get_by_xpath(xmlXPathContextPtr xpath_context,
g_set_error( g_set_error(
err, err,
AG_CHART_ERROR, AG_CHART_ERROR_CORRUPT_FILE, AG_CHART_ERROR, AG_CHART_ERROR_CORRUPT_FILE,
"File '%s' doesn't look like a valid saved chart.", "File '%s' doesn't look like a valid saved chart: "
uri "too many node: %s",
uri, xpath
); );
xmlXPathFreeObject(xpathObj); xmlXPathFreeObject(xpathObj);
@ -469,12 +471,13 @@ get_by_xpath(xmlXPathContextPtr xpath_context,
if (xpathObj->nodesetval->nodeNr == 0) { if (xpathObj->nodesetval->nodeNr == 0) {
if (value_required) { if (value_required) {
g_debug("Too many '%s' nodes", xpath); g_debug("No '%s' nodes", xpath);
g_set_error( g_set_error(
err, err,
AG_CHART_ERROR, AG_CHART_ERROR_CORRUPT_FILE, AG_CHART_ERROR, AG_CHART_ERROR_CORRUPT_FILE,
"File '%s' doesn't look like a valid saved chart.", "File '%s' doesn't look like a valid saved chart: "
uri "missing node: %s",
uri, xpath
); );
xmlXPathFreeObject(xpathObj); xmlXPathFreeObject(xpathObj);
@ -518,8 +521,9 @@ get_by_xpath(xmlXPathContextPtr xpath_context,
g_set_error( g_set_error(
err, err,
AG_CHART_ERROR, AG_CHART_ERROR_CORRUPT_FILE, AG_CHART_ERROR, AG_CHART_ERROR_CORRUPT_FILE,
"File '%s' doesn't look like a valid saved chart.", "File '%s' doesn't look like a valid saved chart: "
uri "Invalid value in node: %s",
uri, xpath
); );
ret = NULL; ret = NULL;
} else { } else {
@ -535,8 +539,9 @@ get_by_xpath(xmlXPathContextPtr xpath_context,
g_set_error( g_set_error(
err, err,
AG_CHART_ERROR, AG_CHART_ERROR_CORRUPT_FILE, AG_CHART_ERROR, AG_CHART_ERROR_CORRUPT_FILE,
"File '%s' doesn't look like a valid saved chart.", "File '%s' doesn't look like a valid saved chart: "
uri "Invalid value in node: %s",
uri, xpath
); );
ret = NULL; ret = NULL;
} else { } else {