From: Klaus Kaempf Date: Mon, 13 Oct 2008 14:49:40 +0000 (+0000) Subject: improve error output X-Git-Tag: BASE-SuSE-Code-12_1-Branch~457 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a43a067e71a131a2cf94d90d2c0f0af05f6fd0e6;p=platform%2Fupstream%2Flibsolv.git improve error output don't exit on error, just skip --- diff --git a/tools/repo_products.c b/tools/repo_products.c index 95a9fc2..6083a02 100644 --- a/tools/repo_products.c +++ b/tools/repo_products.c @@ -91,6 +91,7 @@ static struct stateswitch stateswitches[] = { }; struct parsedata { + const char *filename; int depth; enum state state; int statedepth; @@ -433,8 +434,9 @@ repo_add_product(struct parsedata *pd, FILE *fp, int code11) l = fread(buf, 1, sizeof(buf), fp); if (XML_Parse(parser, buf, l, l == 0) == XML_STATUS_ERROR) { - fprintf(stderr, "repo_products: %s at line %u:%u\n", XML_ErrorString(XML_GetErrorCode(parser)), (unsigned int)XML_GetCurrentLineNumber(parser), (unsigned int)XML_GetCurrentColumnNumber(parser)); - exit(1); + fprintf(stderr, "%s: %s at line %u:%u\n", pd->filename, XML_ErrorString(XML_GetErrorCode(parser)), (unsigned int)XML_GetCurrentLineNumber(parser), (unsigned int)XML_GetCurrentColumnNumber(parser)); + fprintf(stderr, "Skipping this product\n"); + return; } if (l == 0) break; @@ -567,6 +569,7 @@ parse_dir(DIR *dir, const char *path, struct parsedata *pd, int code11) perror(fullpath); break; } + pd->filename = fullpath; repo_add_product(pd, fp, code11); fclose(fp); }