[gnome-terminal] client: Give better error messages



commit 6b39499537221f72311f69d3520176d3f008af87
Author: Christian Persch <chpe gnome org>
Date:   Mon Apr 16 15:09:35 2012 +0200

    client: Give better error messages
    
    Strip remote errors first.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=655126

 src/client.c   |    4 ++++
 src/terminal.c |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/client.c b/src/client.c
index 4595515..1fde9fc 100644
--- a/src/client.c
+++ b/src/client.c
@@ -633,6 +633,7 @@ handle_open (int *argc,
                                                      NULL /* cancellable */,
                                                      &error);
   if (factory == NULL) {
+    g_dbus_error_strip_remote_error (error);
     _printerr ("Error constructing proxy for %s:%s: %s\n", 
                 TERMINAL_UNIQUE_NAME, TERMINAL_FACTORY_OBJECT_PATH,
                 error->message);
@@ -647,6 +648,7 @@ handle_open (int *argc,
           &object_path,
           NULL /* cancellable */,
           &error)) {
+    g_dbus_error_strip_remote_error (error);
     _printerr ("Error creating terminal: %s\n", error->message);
     g_error_free (error);
     g_object_unref (factory);
@@ -664,6 +666,7 @@ handle_open (int *argc,
                                                        NULL /* cancellable */,
                                                        &error);
   if (receiver == NULL) {
+    g_dbus_error_strip_remote_error (error);
     _printerr ("Failed to create proxy for terminal: %s\n", error->message);
     g_error_free (error);
     g_free (object_path);
@@ -681,6 +684,7 @@ handle_open (int *argc,
                                          NULL, /* outfdlist */
                                          NULL /* cancellable */,
                                          &error)) {
+    g_dbus_error_strip_remote_error (error);
     _printerr ("Error: %s\n", error->message);
     g_error_free (error);
     g_clear_object (fd_list);
diff --git a/src/terminal.c b/src/terminal.c
index bad5bd1..f2c78a3 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -233,6 +233,7 @@ main (int argc, char **argv)
                                                      NULL /* cancellable */,
                                                      &error);
   if (factory == NULL) {
+    g_dbus_error_strip_remote_error (error);
     g_printerr ("Error constructing proxy for %s:%s: %s\n", 
                 options->server_bus_name ? options->server_bus_name : TERMINAL_UNIQUE_NAME,
                 TERMINAL_FACTORY_OBJECT_PATH,
@@ -242,6 +243,7 @@ main (int argc, char **argv)
   }
 
   if (!handle_options (factory, options, &error)) {
+    g_dbus_error_strip_remote_error (error);
     g_printerr ("Failed to handle arguments: %s\n", error->message);
   } else {
     exit_code = EXIT_SUCCESS;



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