summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 700f0d80f..26e322f80 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -1119,13 +1119,20 @@ static void reset_all(void)
uemis = 0;
}
-void parse_xml_file(const char *filename)
+void parse_xml_file(const char *filename, GError **error)
{
xmlDoc *doc;
doc = xmlReadFile(filename, NULL, 0);
if (!doc) {
fprintf(stderr, "Failed to parse '%s'.\n", filename);
+ if (error != NULL)
+ {
+ *error = g_error_new(g_quark_from_string("divelog"),
+ DIVE_ERROR_PARSE,
+ "Failed to parse '%s'",
+ filename);
+ }
return;
}