[gnome-software: 1/2] gs-screenshot-image: Don’t warn if download failed due to being offline




commit 58fa9df890d3493c40ec6140ebc7b5587e7c1418
Author: Philip Withnall <withnall endlessm com>
Date:   Tue Sep 1 15:38:53 2020 +0100

    gs-screenshot-image: Don’t warn if download failed due to being offline
    
    Don’t print a warning message if a screenshot couldn’t be downloaded due
    to being offline. This removes some warning spew from the terminal.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    Fixes: #255

 src/gs-screenshot-image.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-screenshot-image.c b/src/gs-screenshot-image.c
index c816a84d3..28d96a814 100644
--- a/src/gs-screenshot-image.c
+++ b/src/gs-screenshot-image.c
@@ -251,9 +251,11 @@ gs_screenshot_image_complete_cb (SoupSession *session,
                return;
        }
        if (msg->status_code != SOUP_STATUS_OK) {
-                g_warning ("Result of screenshot downloading attempt with "
-                          "status code '%u': %s", msg->status_code,
-                          msg->reason_phrase);
+               /* Ignore failures due to being offline */
+               if (msg->status_code != SOUP_STATUS_CANT_RESOLVE)
+                       g_warning ("Result of screenshot downloading attempt with "
+                                  "status code '%u': %s", msg->status_code,
+                                  msg->reason_phrase);
                gs_screenshot_image_stop_spinner (ssimg);
                /* if we're already showing an image, then don't set the error
                 * as having an image (even if outdated) is better */


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