diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2022-10-22 22:33:26 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2022-10-23 13:46:15 +0200 |
commit | c9fd77247bf7ea26e3f9bf532918a6ba69ae8dce (patch) | |
tree | c23b2e3a00beafdc66eaf8927c09b639f83495fc /src | |
parent | 2fa448244f66681f33d935582038b0569e129cca (diff) | |
download | tracker-c9fd77247bf7ea26e3f9bf532918a6ba69ae8dce.tar.gz |
libtracker-sparql: Propagate error through task
We have this same piece of error handling in the caller, we can
just propagate the error forward to the task, and warn there.
Diffstat (limited to 'src')
-rw-r--r-- | src/libtracker-sparql/tracker-endpoint-dbus.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libtracker-sparql/tracker-endpoint-dbus.c b/src/libtracker-sparql/tracker-endpoint-dbus.c index 8ee65a3f4..5a0d4849f 100644 --- a/src/libtracker-sparql/tracker-endpoint-dbus.c +++ b/src/libtracker-sparql/tracker-endpoint-dbus.c @@ -431,7 +431,8 @@ handle_cursor_reply (GTask *task, TrackerSparqlCursor *cursor = source_object; QueryRequest *request = task_data; const gchar **variable_names = NULL; - GError *write_error = NULL; + GError *error = NULL; + gboolean retval; gint i, n_columns; n_columns = tracker_sparql_cursor_get_n_columns (cursor); @@ -441,15 +442,15 @@ handle_cursor_reply (GTask *task, g_dbus_method_invocation_return_value (request->invocation, g_variant_new ("(^as)", variable_names)); - if (!write_cursor (request, cursor, &write_error) && - !g_error_matches (write_error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) - g_warning ("Endpoint failed to fully write cursor: %s\n", write_error->message); + retval = write_cursor (request, cursor, &error); g_free (variable_names); - g_clear_error (&write_error); tracker_sparql_cursor_close (cursor); - g_task_return_boolean (task, TRUE); + if (error) + g_task_return_error (task, error); + else + g_task_return_boolean (task, retval); } static void |