[tracker-miners/wip/carlosg/moved-files: 4/4] tracker-extract: Use distinct error for extraction failures
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/moved-files: 4/4] tracker-extract: Use distinct error for extraction failures
- Date: Tue, 15 Sep 2020 13:47:40 +0000 (UTC)
commit 5f673c1eb9e4638e146ef3e037b925e7f64d618e
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Sep 15 14:50:37 2020 +0200
tracker-extract: Use distinct error for extraction failures
We were inadvertently using the same error message for "tracker3 status"
than we did for crashes/timeouts. Use the error message obtained in that
case, instead of inventing it.
src/tracker-extract/tracker-extract-decorator.c | 28 ++++++++++++++++++-------
1 file changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-decorator.c b/src/tracker-extract/tracker-extract-decorator.c
index bc25ceb72..c9356bd35 100644
--- a/src/tracker-extract/tracker-extract-decorator.c
+++ b/src/tracker-extract/tracker-extract-decorator.c
@@ -63,8 +63,9 @@ static GInitableIface *parent_initable_iface;
static void decorator_get_next_file (TrackerDecorator *decorator);
static void tracker_extract_decorator_initable_iface_init (GInitableIface *iface);
-static void decorator_ignore_file (GFile *file,
- gpointer user_data);
+static void decorator_ignore_file (GFile *file,
+ TrackerExtractDecorator *decorator,
+ const gchar *error_message);
G_DEFINE_TYPE_WITH_CODE (TrackerExtractDecorator, tracker_extract_decorator,
TRACKER_TYPE_DECORATOR_FS,
@@ -166,7 +167,9 @@ get_metadata_cb (TrackerExtract *extract,
}
if (error) {
- decorator_ignore_file (data->file, data->decorator);
+ decorator_ignore_file (data->file,
+ TRACKER_EXTRACT_DECORATOR (data->decorator),
+ error->message);
tracker_decorator_info_complete_error (data->decorator_info, error);
} else {
gchar *resource_sparql, *sparql;
@@ -415,10 +418,10 @@ tracker_extract_decorator_class_init (TrackerExtractDecoratorClass *klass)
}
static void
-decorator_ignore_file (GFile *file,
- gpointer user_data)
+decorator_ignore_file (GFile *file,
+ TrackerExtractDecorator *decorator,
+ const gchar *error_message)
{
- TrackerExtractDecorator *decorator = user_data;
TrackerSparqlConnection *conn;
GError *error = NULL;
gchar *uri, *query;
@@ -434,7 +437,7 @@ decorator_ignore_file (GFile *file,
NULL, &error);
if (info) {
- tracker_error_report (file, "Crash/hang handling file", NULL);
+ tracker_error_report (file, error_message, NULL);
mimetype = g_file_info_get_attribute_string (info,
G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE);
@@ -476,6 +479,15 @@ decorator_ignore_file (GFile *file,
g_free (uri);
}
+static void
+persistence_ignore_file (GFile *file,
+ gpointer user_data)
+{
+ TrackerExtractDecorator *decorator = user_data;
+
+ decorator_ignore_file (file, decorator, "Crash/hang handling file");
+}
+
static void
tracker_extract_decorator_init (TrackerExtractDecorator *decorator)
{
@@ -549,7 +561,7 @@ tracker_extract_decorator_initable_init (GInitable *initable,
ret = FALSE;
}
- priv->persistence = tracker_extract_persistence_initialize (decorator_ignore_file,
+ priv->persistence = tracker_extract_persistence_initialize (persistence_ignore_file,
decorator);
out:
g_clear_object (&conn);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]