summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libtracker-bus/tracker-bus.vala4
-rw-r--r--src/libtracker-sparql/tracker-backend.vala2
-rw-r--r--src/libtracker-sparql/tracker-connection.vala2
-rw-r--r--tests/functional-tests/update-array-performance-test.c4
-rw-r--r--tests/tracker-steroids/tracker-test.c6
5 files changed, 12 insertions, 6 deletions
diff --git a/src/libtracker-bus/tracker-bus.vala b/src/libtracker-bus/tracker-bus.vala
index 252785f39..3f1f9f454 100644
--- a/src/libtracker-bus/tracker-bus.vala
+++ b/src/libtracker-bus/tracker-bus.vala
@@ -107,7 +107,7 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
}
}
- public async override GLib.PtrArray? update_array_async (string[] sparql, int priority = GLib.Priority.DEFAULT, Cancellable? cancellable = null) {
+ public async override GLib.PtrArray? update_array_async (string[] sparql, int priority = GLib.Priority.DEFAULT, Cancellable? cancellable = null) throws Sparql.Error, IOError {
try {
if (priority >= GLib.Priority.DEFAULT) {
return yield tracker_bus_fd_sparql_update_array_async (connection, sparql, cancellable);
@@ -115,7 +115,7 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
return yield tracker_bus_fd_sparql_batch_update_array_async (connection, sparql, cancellable);
}
} catch (DBus.Error e) {
- critical (e.message);
+ throw new Sparql.Error.INTERNAL (e.message);
}
}
diff --git a/src/libtracker-sparql/tracker-backend.vala b/src/libtracker-sparql/tracker-backend.vala
index 4462fc499..85955963f 100644
--- a/src/libtracker-sparql/tracker-backend.vala
+++ b/src/libtracker-sparql/tracker-backend.vala
@@ -135,7 +135,7 @@ class Tracker.Sparql.Backend : Connection {
yield bus.update_async (sparql, priority, cancellable);
}
- public async override GLib.PtrArray? update_array_async (string[] sparql, int priority = GLib.Priority.DEFAULT, Cancellable? cancellable = null)
+ public async override GLib.PtrArray? update_array_async (string[] sparql, int priority = GLib.Priority.DEFAULT, Cancellable? cancellable = null) throws Sparql.Error, IOError
requires (bus != null) {
return yield bus.update_array_async (sparql, priority, cancellable);
}
diff --git a/src/libtracker-sparql/tracker-connection.vala b/src/libtracker-sparql/tracker-connection.vala
index 4cb9df3c9..554ddb6db 100644
--- a/src/libtracker-sparql/tracker-connection.vala
+++ b/src/libtracker-sparql/tracker-connection.vala
@@ -427,7 +427,7 @@ public abstract class Tracker.Sparql.Connection : Object {
}
/* Private API */
- public async virtual GLib.PtrArray? update_array_async (string[] sparql, int priority = GLib.Priority.DEFAULT, Cancellable? cancellable = null) {
+ public async virtual GLib.PtrArray? update_array_async (string[] sparql, int priority = GLib.Priority.DEFAULT, Cancellable? cancellable = null) throws Sparql.Error, IOError {
warning ("Interface 'update_array_async' not implemented");
return null;
}
diff --git a/tests/functional-tests/update-array-performance-test.c b/tests/functional-tests/update-array-performance-test.c
index e8f29f1d7..52c4415c6 100644
--- a/tests/functional-tests/update-array-performance-test.c
+++ b/tests/functional-tests/update-array-performance-test.c
@@ -73,9 +73,11 @@ async_update_array_callback (GObject *source_object,
gpointer user_data)
{
AsyncData *data = user_data;
+ GError *error = NULL;
GPtrArray *errors;
- errors = tracker_sparql_connection_update_array_finish (connection, result);
+ errors = tracker_sparql_connection_update_array_finish (connection, result, &error);
+ g_assert_no_error (error);
g_ptr_array_unref (errors);
g_main_loop_quit (data->main_loop);
}
diff --git a/tests/tracker-steroids/tracker-test.c b/tests/tracker-steroids/tracker-test.c
index 1d15a4852..eb57fadce 100644
--- a/tests/tracker-steroids/tracker-test.c
+++ b/tests/tracker-steroids/tracker-test.c
@@ -299,10 +299,14 @@ async_update_array_callback (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
+ GError *error = NULL;
AsyncData *data = user_data;
GPtrArray *errors;
- errors = tracker_sparql_connection_update_array_finish (connection, result);
+ errors = tracker_sparql_connection_update_array_finish (connection, result, &error);
+
+ /* main error is only set on fatal (D-Bus) errors that apply to the whole update */
+ g_assert_no_error (error);
g_assert (errors->len == 6);