[tracker-miners/wip/carlosg/speed-track: 7/22] libtracker-miner: Forward errors from TrackerFileDataProvider




commit 5a7843377ccaf45c2844b8988a0760fe04498950
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Oct 17 00:11:25 2020 +0200

    libtracker-miner: Forward errors from TrackerFileDataProvider
    
    Instead of maybe warning in place, ensure the errors get forwarded
    further up to the TrackerCrawler.

 src/libtracker-miner/tracker-file-data-provider.c | 37 +++--------------------
 1 file changed, 5 insertions(+), 32 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-data-provider.c 
b/src/libtracker-miner/tracker-file-data-provider.c
index 692595b2d..4ed75cae6 100644
--- a/src/libtracker-miner/tracker-file-data-provider.c
+++ b/src/libtracker-miner/tracker-file-data-provider.c
@@ -75,8 +75,6 @@ file_data_provider_begin (TrackerDataProvider    *data_provider,
                           GError                **error)
 {
        GFileQueryInfoFlags file_flags;
-       GFileEnumerator *fe;
-       GError *local_error = NULL;
 
        if (g_cancellable_set_error_if_cancelled (cancellable, error)) {
                return NULL;
@@ -94,27 +92,11 @@ file_data_provider_begin (TrackerDataProvider    *data_provider,
 
        file_flags = G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS;
 
-       fe = g_file_enumerate_children (url,
-                                       attributes,
-                                       file_flags,
-                                       cancellable,
-                                       &local_error);
-
-       if (local_error) {
-               gchar *uri;
-
-               uri = g_file_get_uri (url);
-
-               g_warning ("Could not open directory '%s': %s",
-                          uri, local_error->message);
-
-               g_propagate_error (error, local_error);
-               g_free (uri);
-
-               return NULL;
-       }
-
-       return fe;
+       return g_file_enumerate_children (url,
+                                         attributes,
+                                         file_flags,
+                                         cancellable,
+                                         error);
 }
 
 static void
@@ -129,15 +111,6 @@ enumerate_children_cb (GObject       *source_object,
 
        enumerator = g_file_enumerate_children_finish (url, res, &error);
        if (error) {
-               if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
-                       gchar *uri;
-
-                       uri = g_file_get_uri (url);
-                       g_warning ("Could not open directory '%s': %s",
-                                  uri, error->message);
-                       g_free (uri);
-               }
-
                g_task_return_error (task, error);
        } else {
                g_task_return_pointer (task, enumerator, (GDestroyNotify) g_object_unref);


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