[tracker/wip/carlosg/new-error-codes: 1/2] libtracker-sparql: Add specific error code for missing nrl:lastModified
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/new-error-codes: 1/2] libtracker-sparql: Add specific error code for missing nrl:lastModified
- Date: Tue, 5 Oct 2021 14:18:32 +0000 (UTC)
commit aee7cd453c2ee1b7d4404c22b737d95c50cad25a
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Oct 5 15:05:19 2021 +0200
libtracker-sparql: Add specific error code for missing nrl:lastModified
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 14ca1a71a..d1a8edc83 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -2121,7 +2121,7 @@ get_ontology_from_file (TrackerDataManager *manager,
if (ret == NULL) {
g_set_error (error,
TRACKER_SPARQL_ERROR,
- TRACKER_SPARQL_ERROR_OPEN_ERROR,
+ TRACKER_SPARQL_ERROR_MISSING_LAST_MODIFIED_HEADER,
"%s: Ontology has no nrl:lastModified header", ontology_uri);
goto out;
}
diff --git a/src/libtracker-sparql/tracker-error.c b/src/libtracker-sparql/tracker-error.c
index 730655968..ec649a67c 100644
--- a/src/libtracker-sparql/tracker-error.c
+++ b/src/libtracker-sparql/tracker-error.c
@@ -35,6 +35,7 @@ static const GDBusErrorEntry tracker_sparql_error_entries[] =
{TRACKER_SPARQL_ERROR_UNKNOWN_GRAPH, "org.freedesktop.Tracker.Error.UnknownGraph"},
{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"},
};
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 68c48d094..95ca6f6a0 100644
--- a/src/libtracker-sparql/tracker-error.h
+++ b/src/libtracker-sparql/tracker-error.h
@@ -50,6 +50,7 @@ G_BEGIN_DECLS
* @TRACKER_SPARQL_ERROR_UNKNOWN_GRAPH: Unknown graph.
* @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_N_ERRORS: The total number of error codes.
*
* Error domain for Tracker Sparql. Errors in this domain will be from the
@@ -69,6 +70,7 @@ typedef enum {
TRACKER_SPARQL_ERROR_UNKNOWN_GRAPH,
TRACKER_SPARQL_ERROR_UNKNOWN_PROPERTY,
TRACKER_SPARQL_ERROR_UNSUPPORTED,
+ TRACKER_SPARQL_ERROR_MISSING_LAST_MODIFIED_HEADER,
TRACKER_SPARQL_N_ERRORS,
} TrackerSparqlError;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]