[epiphany/wip/fixes: 2/15] Add some error checking when getting snapshots



commit 95d39bf6c6792010a79a70f9c72eac07adfac89c
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri Feb 26 22:05:01 2016 -0600

    Add some error checking when getting snapshots
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761065

 embed/ephy-about-handler.c |    7 ++++++-
 embed/ephy-web-view.c      |    7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/embed/ephy-about-handler.c b/embed/ephy-about-handler.c
index 614b6bd..b64fcb0 100644
--- a/embed/ephy-about-handler.c
+++ b/embed/ephy-about-handler.c
@@ -414,11 +414,16 @@ got_snapshot_path_for_url_cb (EphySnapshotService *service,
                               GetSnapshotPathAsyncData *data)
 {
   char *snapshot;
+  GError *error = NULL;
 
-  snapshot = ephy_snapshot_service_get_snapshot_path_for_url_finish (service, result, NULL);
+  snapshot = ephy_snapshot_service_get_snapshot_path_for_url_finish (service, result, &error);
   if (snapshot) {
     ephy_embed_shell_set_thumbnail_path (ephy_embed_shell_get_default (), data->url, data->mtime, snapshot);
     g_free (snapshot);
+  } else {
+    /* Bad luck, not something to warn about. */
+    g_info ("Failed to get snapshot for URL %s: %s", data->url, error->message);
+    g_error_free (error);
   }
   g_free (data->url);
   g_free (data);
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index a37a992..974c0ba 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -589,11 +589,16 @@ got_snapshot_path_cb (EphySnapshotService *service,
                       GetSnapshotPathAsyncData *data)
 {
   char *snapshot;
+  GError *error = NULL;
 
-  snapshot = ephy_snapshot_service_get_snapshot_path_finish (service, result, NULL);
+  snapshot = ephy_snapshot_service_get_snapshot_path_finish (service, result, &error);
   if (snapshot) {
     ephy_embed_shell_set_thumbnail_path (ephy_embed_shell_get_default (), data->url, data->mtime, snapshot);
     g_free (snapshot);
+  } else {
+    /* Bad luck, not something to warn about. */
+    g_info ("Failed to get snapshot for URL %s: %s", data->url, error->message);
+    g_error_free (error);
   }
   g_free (data->url);
   g_free (data);


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