]> git.0d.be Git - empathy.git/commitdiff
common_checks: tell the truth in debug messages
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 18 Mar 2011 09:27:23 +0000 (10:27 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 18 Mar 2011 09:27:23 +0000 (10:27 +0100)
It's really confusing to read a "Can't handle.." error while it's actually an
observe error.

libempathy/empathy-auth-factory.c

index 96b6bf58aa781eca536e7823bdccd1293e08c1c1..b005b7a7c7667d81ed1f6935125e862becbc95e0 100644 (file)
@@ -183,9 +183,9 @@ common_checks (EmpathyAuthFactory *self,
    */
   if (g_list_length (channels) != 1)
     {
-      g_set_error_literal (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
-          "Can't handle more than one ServerTLSConnection or ServerAuthentication "
-          "channel for the same connection.");
+      g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+          "Can't %s more than one ServerTLSConnection or ServerAuthentication "
+          "channel for the same connection.", observe ? "observe" : "handle");
 
       return FALSE;
     }
@@ -203,8 +203,9 @@ common_checks (EmpathyAuthFactory *self,
           EMP_IFACE_QUARK_CHANNEL_TYPE_SERVER_TLS_CONNECTION)
         {
           g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
-              "Can only handle ServerTLSConnection or ServerAuthentication channels, "
-              "this was a %s channel", tp_channel_get_channel_type (channel));
+              "Can only %s ServerTLSConnection or ServerAuthentication channels, "
+              "this was a %s channel", observe ? "observe" : "handle",
+              tp_channel_get_channel_type (channel));
 
           return FALSE;
         }
@@ -214,8 +215,9 @@ common_checks (EmpathyAuthFactory *self,
       TP_IFACE_QUARK_CHANNEL_TYPE_SERVER_AUTHENTICATION
       && priv->sasl_handler != NULL)
     {
-      g_set_error_literal (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
-          "Can't handle more than one ServerAuthentication channel at one time");
+      g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT,
+          "Can't %s more than one ServerAuthentication channel at one time",
+          observe ? "observe" : "handle");
 
       return FALSE;
     }