[gimp] app: do not use g_error() for non-fatale errors...
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: do not use g_error() for non-fatale errors...
- Date: Tue, 16 Sep 2014 22:18:37 +0000 (UTC)
commit ce2bb29605941448e29912f84bc023e53371f6c7
Author: Jehan <jehan girinstud io>
Date: Wed Sep 17 00:08:33 2014 +0200
app: do not use g_error() for non-fatale errors...
and g_warning() for programming errors only.
Use g_printerr() for "normal" errors which may happen in a program
lifetime (in particular corrupted XCF file errors are not necessarily
programming errors).
app/xcf/xcf-load.c | 12 +++++++-----
app/xcf/xcf-save.c | 5 ++---
2 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c
index b36b240..f9f1e6a 100644
--- a/app/xcf/xcf-load.c
+++ b/app/xcf/xcf-load.c
@@ -1791,11 +1791,13 @@ xcf_load_level (XcfInfo *info,
fail = TRUE;
break;
case COMPRESS_FRACTAL:
- g_warning ("xcf: fractal compression unimplemented");
+ g_printerr ("xcf: fractal compression unimplemented. "
+ "Possibly corrupt XCF file.");
fail = TRUE;
break;
default:
- g_warning ("xcf: unknown compression");
+ g_printerr ("xcf: unknown compression. "
+ "Possibly corrupt XCF file.");
fail = TRUE;
break;
}
@@ -2086,8 +2088,8 @@ xcf_load_parasite (XcfInfo *info)
if (size > MAX_XCF_PARASITE_DATA_LEN)
{
- g_warning ("Maximum parasite data length (%ld bytes) exceeded. "
- "Possibly corrupt XCF file.", MAX_XCF_PARASITE_DATA_LEN);
+ g_printerr ("Maximum parasite data length (%ld bytes) exceeded. "
+ "Possibly corrupt XCF file.", MAX_XCF_PARASITE_DATA_LEN);
g_free (name);
return NULL;
}
@@ -2166,7 +2168,7 @@ xcf_load_old_path (XcfInfo *info,
}
else if (version != 1)
{
- g_warning ("Unknown path type. Possibly corrupt XCF file");
+ g_printerr ("Unknown path type. Possibly corrupt XCF file");
return FALSE;
}
diff --git a/app/xcf/xcf-save.c b/app/xcf/xcf-save.c
index 5a6de8a..d972054 100644
--- a/app/xcf/xcf-save.c
+++ b/app/xcf/xcf-save.c
@@ -1520,8 +1520,8 @@ xcf_save_level (XcfInfo *info,
error));
break;
case COMPRESS_FRACTAL:
- g_error ("xcf: fractal compression unimplemented");
- break;
+ g_warning ("xcf: fractal compression unimplemented");
+ return FALSE;
}
/* seek back to where we are to write out the next
@@ -1549,7 +1549,6 @@ xcf_save_level (XcfInfo *info,
xcf_write_int32_check_error (info, &offset, 1);
return TRUE;
-
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]