[tracker/wip/carlosg/new-error-codes: 2/2] libtracker-sparql: Add specific error code for incomplete properties
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/new-error-codes: 2/2] libtracker-sparql: Add specific error code for incomplete properties
- Date: Tue, 5 Oct 2021 14:18:32 +0000 (UTC)
commit fb36e343693dfab3210ed5dfd3f78da7b0fcbeb7
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Oct 5 15:07:40 2021 +0200
libtracker-sparql: Add specific error code for incomplete properties
Add a new error code for this specific error situation when parsing the
database ontology. Based on code by Abanoub Ghadban <abanoub gdb gmail com>.
src/libtracker-data/tracker-data-manager.c | 2 +-
src/libtracker-sparql/tracker-error.c | 1 +
src/libtracker-sparql/tracker-error.h | 2 ++
3 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index d1a8edc83..dad0fa323 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -1963,7 +1963,7 @@ check_properties_completeness (TrackerOntologies *ontologies,
g_set_error (error,
TRACKER_SPARQL_ERROR,
- TRACKER_SPARQL_ERROR_OPEN_ERROR,
+ TRACKER_SPARQL_ERROR_INCOMPLETE_PROPERTY_DEFINITION,
"%s: Property %s has no defined %s.",
definition_location, property_name, missing_definition);
diff --git a/src/libtracker-sparql/tracker-error.c b/src/libtracker-sparql/tracker-error.c
index ec649a67c..8be2effc2 100644
--- a/src/libtracker-sparql/tracker-error.c
+++ b/src/libtracker-sparql/tracker-error.c
@@ -36,6 +36,7 @@ static const GDBusErrorEntry tracker_sparql_error_entries[] =
{TRACKER_SPARQL_ERROR_UNKNOWN_PROPERTY, "org.freedesktop.Tracker.Error.UnknownProperty"},
{TRACKER_SPARQL_ERROR_UNSUPPORTED, "org.freedesktop.Tracker.Error.Unsupported"},
{TRACKER_SPARQL_ERROR_MISSING_LAST_MODIFIED_HEADER,
"org.freedesktop.Tracker.Error.MissingLastModifiedHeader"},
+ {TRACKER_SPARQL_ERROR_INCOMPLETE_PROPERTY_DEFINITION,
"org.freedesktop.Tracker.Error.IncompleteProperty"},
};
G_STATIC_ASSERT (G_N_ELEMENTS (tracker_sparql_error_entries) == TRACKER_SPARQL_N_ERRORS);
diff --git a/src/libtracker-sparql/tracker-error.h b/src/libtracker-sparql/tracker-error.h
index 95ca6f6a0..e56cfb2c1 100644
--- a/src/libtracker-sparql/tracker-error.h
+++ b/src/libtracker-sparql/tracker-error.h
@@ -51,6 +51,7 @@ G_BEGIN_DECLS
* @TRACKER_SPARQL_ERROR_UNKNOWN_PROPERTY: Unknown property.
* @TRACKER_SPARQL_ERROR_UNSUPPORTED: Unsupported feature or method.
* @TRACKER_SPARQL_ERROR_MISSING_LAST_MODIFIED_HEADER: The ontology doesn't contain nrl:lastModified header
+ * @TRACKER_SPARQL_ERROR_INCOMPLETE_PROPERTY_DEFINITION: The property is not completely defined.
* @TRACKER_SPARQL_N_ERRORS: The total number of error codes.
*
* Error domain for Tracker Sparql. Errors in this domain will be from the
@@ -71,6 +72,7 @@ typedef enum {
TRACKER_SPARQL_ERROR_UNKNOWN_PROPERTY,
TRACKER_SPARQL_ERROR_UNSUPPORTED,
TRACKER_SPARQL_ERROR_MISSING_LAST_MODIFIED_HEADER,
+ TRACKER_SPARQL_ERROR_INCOMPLETE_PROPERTY_DEFINITION,
TRACKER_SPARQL_N_ERRORS,
} TrackerSparqlError;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]