[tracker/rss-enclosures] libtracker-bus: Fix D-Bus error handling for blank updates



commit b7d7553f675ac9e3b339c29803c7c0be0b371a5b
Author: Jürg Billeter <j bitron ch>
Date:   Fri Aug 13 10:19:50 2010 +0200

    libtracker-bus: Fix D-Bus error handling for blank updates

 src/libtracker-bus/tracker-bus.vala |   34 +++++++++++++++++++++-------------
 1 files changed, 21 insertions(+), 13 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus.vala b/src/libtracker-bus/tracker-bus.vala
index 8e4264c..c1164ad 100644
--- a/src/libtracker-bus/tracker-bus.vala
+++ b/src/libtracker-bus/tracker-bus.vala
@@ -137,26 +137,34 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
 	}
 
 	public override GLib.Variant? update_blank (string sparql, int priority = GLib.Priority.DEFAULT, Cancellable? cancellable = null) throws Sparql.Error, IOError {
-		GLib.Variant res = null;
+		try {
+			GLib.Variant res = null;
 
-		if (use_steroids) {
-			res = tracker_bus_fd_sparql_update_blank (connection, sparql);
-		} else {
-			res = tracker_bus_array_sparql_update_blank (connection, sparql);
+			if (use_steroids) {
+				res = tracker_bus_fd_sparql_update_blank (connection, sparql);
+			} else {
+				res = tracker_bus_array_sparql_update_blank (connection, sparql);
+			}
+			return res;
+		} catch (DBus.Error e) {
+			throw new Sparql.Error.INTERNAL (e.message);
 		}
-		return res;
 	}
 
 	public async override GLib.Variant? update_blank_async (string sparql, int priority = GLib.Priority.DEFAULT, Cancellable? cancellable = null) throws Sparql.Error, IOError {
-		GLib.Variant res = null;
+		try {
+			GLib.Variant res = null;
 
-		if (use_steroids) {
-			res = yield tracker_bus_fd_sparql_update_blank_async (connection, sparql, cancellable);
-		} else {
-			res = yield tracker_bus_array_sparql_update_blank_async (connection, sparql, cancellable);
-		}
+			if (use_steroids) {
+				res = yield tracker_bus_fd_sparql_update_blank_async (connection, sparql, cancellable);
+			} else {
+				res = yield tracker_bus_array_sparql_update_blank_async (connection, sparql, cancellable);
+			}
 
-		return res;
+			return res;
+		} catch (DBus.Error e) {
+			throw new Sparql.Error.INTERNAL (e.message);
+		}
 	}
 
 	public override void load (File file, Cancellable? cancellable = null) throws Sparql.Error, IOError {



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