[gnome-boxes] osinfo: ignore db loading errors



commit f3583de3e13b742729765fabbe7a58afb17de6d9
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Tue Sep 4 17:08:48 2012 +0200

    osinfo: ignore db loading errors
    
    When reading libosinfo OS database, errors will get reported when a
    file is invalid, missing, ... When this happens, we currently
    give up on using libosinfo. This commit catches osinfo DB load errors,
    but make sure we still try to use the libosinfo DB. At worse it will
    be empty, but in most cases it should give us access to a partial
    DB.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683271

 src/os-database.vala |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/os-database.vala b/src/os-database.vala
index 9885b43..52682ac 100644
--- a/src/os-database.vala
+++ b/src/os-database.vala
@@ -30,8 +30,16 @@ private class Boxes.OSDatabase {
 
     public void load () throws GLib.Error {
         var loader = new Loader ();
-        loader.process_default_path ();
-        loader.process_path (get_logos_db ()); // Load our custom database
+        try {
+            loader.process_default_path ();
+        } catch (GLib.Error e) {
+            warning ("Error loading default libosinfo database: %s", e.message);
+        }
+        try {
+            loader.process_path (get_logos_db ()); // Load our custom database
+        } catch (GLib.Error e) {
+            warning ("Error loading GNOME Boxes libosinfo database: %s", e.message);
+        }
         db = loader.get_db ();
     }
 



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