[gnome-software] snap: Return errors of the correct domain
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] snap: Return errors of the correct domain
- Date: Tue, 4 Apr 2017 09:57:30 +0000 (UTC)
commit 6823988fa6318a798e61c7988f7674b48718c023
Author: Richard Hughes <richard hughsie com>
Date: Tue Apr 4 09:58:25 2017 +0100
snap: Return errors of the correct domain
If we cancel the action because of search-as-you-type then we don't want a
console warning each time.
plugins/snap/gs-snapd.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/plugins/snap/gs-snapd.c b/plugins/snap/gs-snapd.c
index 74899d8..81f223e 100644
--- a/plugins/snap/gs-snapd.c
+++ b/plugins/snap/gs-snapd.c
@@ -27,6 +27,8 @@
#include <libsoup/soup.h>
#include <gio/gunixsocketaddress.h>
+#include <gnome-software.h>
+
#include "gs-snapd.h"
// snapd API documentation is at https://github.com/snapcore/snapd/blob/master/docs/rest.md
@@ -89,8 +91,10 @@ read_from_snapd (GSocket *socket,
size,
cancellable,
error);
- if (n_read < 0)
+ if (n_read < 0) {
+ gs_utils_error_convert_gio (error);
return FALSE;
+ }
*read_offset += (gsize) n_read;
buffer->data[*read_offset] = '\0';
@@ -150,8 +154,10 @@ send_request (const gchar *method,
/* send HTTP request */
n_written = g_socket_send (socket, request->str, request->len, cancellable, error);
- if (n_written < 0)
+ if (n_written < 0) {
+ gs_utils_error_convert_gio (error);
return FALSE;
+ }
/* read HTTP headers */
buffer = g_byte_array_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]