mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Report errors when opening files
Signed-off-by: Nathan Samson <nathansamson@gmail.com>
This commit is contained in:
parent
65ef1bae20
commit
11becb8750
5 changed files with 100 additions and 25 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue