[evolution-ews] Report error coherently



commit 2748e5f17e66fa0e15243ee316dbc0e50408eb57
Author: David Woodhouse <David Woodhouse intel com>
Date:   Wed May 15 12:33:33 2013 +0100

    Report error coherently

 src/addressbook/lzx/gal-lzx-decompress-test.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/addressbook/lzx/gal-lzx-decompress-test.c b/src/addressbook/lzx/gal-lzx-decompress-test.c
index a14f25e..9185ca8 100644
--- a/src/addressbook/lzx/gal-lzx-decompress-test.c
+++ b/src/addressbook/lzx/gal-lzx-decompress-test.c
@@ -1,10 +1,12 @@
 
 #include "ews-oal-decompress.h"
+#include <glib.h>
 
 gint
-main (gint argc,
-      gchar *argv[])
+main (gint argc, gchar *argv[])
 {
+       GError *error = NULL;
+
        if (argc != 3 && argc != 4) {
                g_print ("Pass an lzx file and an output filename as argument \n");
                return -1;
@@ -13,17 +15,17 @@ main (gint argc,
        if (argc == 4) {
                g_print("Applying binary patch %s to %s to create %s\n",
                        argv[1], argv[2], argv[3]);
-               if (oal_apply_binpatch(argv[1], argv[2], argv[3], NULL))
+               if (oal_apply_binpatch(argv[1], argv[2], argv[3], &error))
                        g_print("Successfully applied\n");
                else
-                       g_print("apply failed\n");
+                       g_print("apply failed: %s\n", error->message);
        } else
 
 
-       if (oal_decompress_v4_full_detail_file (argv[1], argv[2], NULL))
+       if (oal_decompress_v4_full_detail_file (argv[1], argv[2], &error))
                g_print ("Successfully decompressed \n");
        else
-               g_print ("decompression failed \n");
+               g_print ("decompression failed: %s\n", error->message);
 
        return 0;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]