[gnome-documents] documents: handle exceptions for Gtk.show_uri()



commit c2f2e78bd1c15f03d35af813f7620f51d5beeffd
Author: Feroze Naina <ferozenaina gmail com>
Date:   Fri Apr 6 19:26:52 2012 +0530

    documents: handle exceptions for Gtk.show_uri()
    
    Gtk.show_uri() might fail for whatever reason, so surround it in a
    try/catch block and log a warning on the command line when it happens.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673521

 src/documents.js |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/documents.js b/src/documents.js
index feb1f19..b12090b 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -585,7 +585,11 @@ DocCommon.prototype = {
     },
 
     open: function(screen, timestamp) {
-        Gtk.show_uri(screen, this.uri, timestamp);
+        try {
+            Gtk.show_uri(screen, this.uri, timestamp);
+        } catch (e) {
+            log('Unable to show URI ' + this.uri + ': ' + e.toString());
+        }
     },
 
     setFavorite: function(favorite) {



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