[jsonrpc-glib] client: ensure we pass an error to panic



commit a229929531e82106517a49167cb797c861958114
Author: Christian Hergert <chergert redhat com>
Date:   Mon Feb 19 13:42:58 2018 -0800

    client: ensure we pass an error to panic

 src/jsonrpc-client.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/jsonrpc-client.c b/src/jsonrpc-client.c
index 518b92e..7ce6408 100644
--- a/src/jsonrpc-client.c
+++ b/src/jsonrpc-client.c
@@ -670,6 +670,9 @@ jsonrpc_client_call_read_cb (GObject      *object,
   /* Make sure we got a proper type back from the variant. */
   if (!g_variant_is_of_type (message, G_VARIANT_TYPE_VARDICT))
     {
+      error = g_error_new_literal (G_IO_ERROR,
+                                   G_IO_ERROR_INVALID_DATA,
+                                   "Improper reply from peer, not a vardict");
       jsonrpc_client_panic (self, error);
       return;
     }
@@ -685,7 +688,7 @@ jsonrpc_client_call_read_cb (GObject      *object,
     {
       error = g_error_new_literal (G_IO_ERROR,
                                    G_IO_ERROR_INVALID_DATA,
-                                   "Received malformed response from peer");
+                                   "Improper reply from peer");
       jsonrpc_client_panic (self, error);
       return;
     }


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