[gnome-network-displays/cc-tmp: 76/80] cc: replace g_error with g_warning




commit b7c9fcbafada91487af38d34396efa65e0238057
Author: Anupam Kumar <kyteinsky gmail com>
Date:   Tue Sep 6 19:45:33 2022 +0530

    cc: replace g_error with g_warning

 src/cc/cc-comm.c | 24 ++++++++++++------------
 src/cc/cc-comm.h |  2 +-
 src/cc/cc-ctrl.c | 24 ++++++++++++------------
 3 files changed, 25 insertions(+), 25 deletions(-)
---
diff --git a/src/cc/cc-comm.c b/src/cc/cc-comm.c
index 5f479e6..b93246a 100644
--- a/src/cc/cc-comm.c
+++ b/src/cc/cc-comm.c
@@ -114,7 +114,7 @@ cc_comm_message_read_cb (GObject      *source_object,
 
   if (!comm->con)
     {
-      g_error ("CcComm: Connection error while reading message body");
+      g_warning ("CcComm: Connection error while reading message body");
       comm->closure->error_close_connection_cb (comm->closure->userdata, NULL);
       return;
     }
@@ -129,11 +129,11 @@ cc_comm_message_read_cb (GObject      *source_object,
     {
       if (error)
         {
-          g_error ("CcComm: Error reading message from stream: %s", error->message);
+          g_warning ("CcComm: Error reading message from stream: %s", error->message);
           comm->closure->error_close_connection_cb (comm->closure->userdata, g_steal_pointer (&error));
           return;
         }
-      g_error ("CcComm: Error reading message from stream.");
+      g_warning ("CcComm: Error reading message from stream.");
       comm->closure->error_close_connection_cb (comm->closure->userdata, NULL);
       return;
     }
@@ -168,7 +168,7 @@ cc_comm_header_read_cb (GObject      *source_object,
 
   if (!comm->con)
     {
-      g_error ("CcComm: Connection error while reading header");
+      g_warning ("CcComm: Connection error while reading header");
       comm->closure->error_close_connection_cb (comm->closure->userdata, NULL);
       return;
     }
@@ -185,11 +185,11 @@ cc_comm_header_read_cb (GObject      *source_object,
     {
       if (error)
         {
-          g_error ("CcComm: Error reading header from stream: %s", error->message);
+          g_warning ("CcComm: Error reading header from stream: %s", error->message);
           comm->closure->error_close_connection_cb (comm->closure->userdata, g_steal_pointer (&error));
           return;
         }
-      g_error ("CcComm: Error reading header from stream.");
+      g_warning ("CcComm: Error reading header from stream.");
       comm->closure->error_close_connection_cb (comm->closure->userdata, NULL);
       return;
     }
@@ -244,14 +244,14 @@ cc_comm_make_connection (CcComm *comm, gchar *remote_address, GError **error)
   socket = g_socket_new (socket_family, socket_type, G_SOCKET_PROTOCOL_DEFAULT, error);
   if (socket == NULL)
     {
-      g_error ("CcComm: Failed to create socket");
+      g_warning ("CcComm: Failed to create socket");
       return FALSE;
     }
 
   connectable = g_network_address_parse (remote_address, 8009, error);
   if (connectable == NULL)
     {
-      g_error ("CcComm: Failed to create connectable");
+      g_warning ("CcComm: Failed to create connectable");
       return FALSE;
     }
 
@@ -261,7 +261,7 @@ cc_comm_make_connection (CcComm *comm, gchar *remote_address, GError **error)
       GSocketAddress * address = g_socket_address_enumerator_next (enumerator, comm->cancellable, error);
       if (address == NULL)
         {
-          g_error ("CcComm: Failed to create address");
+          g_warning ("CcComm: Failed to create address");
           return FALSE;
         }
 
@@ -334,7 +334,7 @@ cc_comm_tls_send (CcComm  * comm,
 
   if (!G_IS_TLS_CONNECTION (comm->con))
     {
-      g_error ("Connection has not been established");
+      g_warning ("Connection has not been established");
       comm->closure->error_close_connection_cb (comm->closure->userdata, NULL);
       return FALSE;
     }
@@ -455,7 +455,7 @@ cc_comm_send_request (CcComm       *comm,
                                   &binary_payload,
                                   NULL))
         {
-          g_error ("Auth message building failed!");
+          g_warning ("Auth message building failed!");
           return FALSE;
         }
       break;
@@ -469,7 +469,7 @@ cc_comm_send_request (CcComm       *comm,
                                   NULL,
                                   utf8_payload))
         {
-          g_error ("Message building failed for message type: %d", message_type);
+          g_warning ("Message building failed for message type: %d", message_type);
           return FALSE;
         }
     }
diff --git a/src/cc/cc-comm.h b/src/cc/cc-comm.h
index bcd00e9..be4f065 100644
--- a/src/cc/cc-comm.h
+++ b/src/cc/cc-comm.h
@@ -32,7 +32,7 @@ struct _CcCommClosure
   void     (*message_received_cb) (gpointer                    userdata,
                                    Cast__Channel__CastMessage *message);
   void     (*error_close_connection_cb) (gpointer userdata,
-                              GError  *error);
+                                         GError  *error);
 };
 
 typedef struct _CcCommClosure CcCommClosure;
diff --git a/src/cc/cc-ctrl.c b/src/cc/cc-ctrl.c
index 1358b4b..4b39c3b 100644
--- a/src/cc/cc-ctrl.c
+++ b/src/cc/cc-ctrl.c
@@ -316,7 +316,7 @@ cc_ctrl_check_waiting_for (CcCtrl *ctrl)
   if (ctrl->waiting_for == CC_RWAIT_TYPE_NONE)
     return G_SOURCE_CONTINUE;
 
-  g_error ("CcCtrl: Timed out waiting for %d", ctrl->waiting_for);
+  g_warning ("CcCtrl: Timed out waiting for %d", ctrl->waiting_for);
   cc_ctrl_close_connection (ctrl);
 
   return G_SOURCE_REMOVE;
@@ -334,7 +334,7 @@ cc_ctrl_send_ping (CcCtrl *ctrl)
                              CC_MESSAGE_TYPE_PING,
                              NULL))
     {
-      g_error ("CcCtrl: Failed to send ping message");
+      g_warning ("CcCtrl: Failed to send ping message");
       return G_SOURCE_REMOVE;
     }
 
@@ -363,7 +363,7 @@ cc_ctrl_mirroring_app_init (CcCtrl *ctrl)
   g_autoptr(GError) err = NULL;
   if (!cc_ctrl_send_connect (ctrl, ctrl->session_id))
     {
-      g_error ("CcCtrl: Failed to send CONNECT to the mirroring app");
+      g_warning ("CcCtrl: Failed to send CONNECT to the mirroring app");
       return;
     }
 
@@ -388,7 +388,7 @@ cc_ctrl_handle_get_app_availability (CcCtrl *ctrl, JsonReader *reader)
               /* launch the app now */
               if (!cc_ctrl_send_launch_app (ctrl, CC_DEFAULT_RECEIVER_ID, CC_MIRRORING_APP_ID))
                 {
-                  g_error ("CcCtrl: Failed to launch the app");
+                  g_warning ("CcCtrl: Failed to launch the app");
                   return;
                 }
             }
@@ -431,7 +431,7 @@ cc_ctrl_handle_receiver_status (CcCtrl *ctrl, JsonParser *parser)
 
       if (!cc_ctrl_send_launch_app (ctrl, CC_DEFAULT_RECEIVER_ID, CC_MIRRORING_APP_ID))
         {
-          g_error ("CcCtrl: Failed to launch the app");
+          g_warning ("CcCtrl: Failed to launch the app");
           return;
         }
 
@@ -470,7 +470,7 @@ cc_ctrl_handle_receiver_status (CcCtrl *ctrl, JsonParser *parser)
               /* some other app is open, check if `CC_MIRRORING_APP_ID` is available */
               if (!cc_ctrl_send_get_app_availability (ctrl, CC_MIRRORING_APP_ID, CC_DEFAULT_RECEIVER_ID))
                 {
-                  g_error ("CcCtrl: Failed to send GET_APP_AVAILABILITY");
+                  g_warning ("CcCtrl: Failed to send GET_APP_AVAILABILITY");
                   return;
                 }
             }
@@ -504,7 +504,7 @@ cc_ctrl_handle_close (CcCtrl *ctrl, Cast__Channel__CastMessage *message)
   /* the app closed */
   g_debug ("CcCtrl: App sent a close message, launching again");
   if (!cc_ctrl_send_launch_app (ctrl, CC_DEFAULT_RECEIVER_ID, CC_MIRRORING_APP_ID))
-    g_error ("CcCtrl: Failed to launch app");
+    g_warning ("CcCtrl: Failed to launch app");
 }
 
 void
@@ -602,7 +602,7 @@ cc_ctrl_error_close_connection_cb (gpointer userdata, GError *error)
   if (error)
     g_warning ("CcCtrl: Connection error: %s", error->message);
   else
-    g_error ("CcCtrl: Connection error");
+    g_warning ("CcCtrl: Connection error");
 
   ctrl = (CcCtrl *) userdata;
   cc_ctrl_close_connection (ctrl);
@@ -665,7 +665,7 @@ cc_ctrl_connection_init (CcCtrl *ctrl, gchar *remote_address)
   /* we can skip some message interchange if the mirroring app is already up */
   if (!cc_ctrl_send_get_status (ctrl, CC_DEFAULT_RECEIVER_ID))
     {
-      g_error ("CcCtrl: Failed to send get status");
+      g_warning ("CcCtrl: Failed to send get status");
       return FALSE;
     }
 
@@ -685,15 +685,15 @@ cc_ctrl_finish (CcCtrl *ctrl)
   if (ctrl->state >= CC_CTRL_STATE_APP_OPEN)
     {
       if (!cc_ctrl_send_disconnect (ctrl, CC_DEFAULT_RECEIVER_ID))
-        g_error ("CcCtrl: Error closing virtual connection to app");
+        g_warning ("CcCtrl: Error closing virtual connection to app");
       if (!cc_ctrl_send_close_app (ctrl, ctrl->session_id))
-        g_error ("CcCtrl: Error closing app");
+        g_warning ("CcCtrl: Error closing app");
       g_clear_pointer (&ctrl->session_id, g_free);
     }
 
   /* close the virtual connection */
   if (!cc_ctrl_send_disconnect (ctrl, CC_DEFAULT_RECEIVER_ID))
-    g_error ("CcCtrl: Error closing virtual connection");
+    g_warning ("CcCtrl: Error closing virtual connection");
 
   /* free up the resources */
   g_clear_pointer (&ctrl->comm.closure, g_free);


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