[tracker/wip/carlosg/update-perf: 5/65] libtracker-data: Propagate error message on constraint errors




commit 035c16909e5bd3e9e43d590157570f90b2d2bb19
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jan 16 21:10:32 2022 +0100

    libtracker-data: Propagate error message on constraint errors
    
    These may hold more detailed information, like the property that
    broke the constraint.

 src/libtracker-sparql/core/tracker-db-interface-sqlite.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/libtracker-sparql/core/tracker-db-interface-sqlite.c 
b/src/libtracker-sparql/core/tracker-db-interface-sqlite.c
index 49f6764f4..5a7ac18c7 100644
--- a/src/libtracker-sparql/core/tracker-db-interface-sqlite.c
+++ b/src/libtracker-sparql/core/tracker-db-interface-sqlite.c
@@ -2951,7 +2951,8 @@ execute_stmt (TrackerDBInterface  *interface,
                                g_set_error (error,
                                             TRACKER_DB_INTERFACE_ERROR,
                                             TRACKER_DB_CONSTRAINT,
-                                            "Constraint would be broken");
+                                            "Constraint would be broken: %s",
+                                            sqlite3_errmsg (interface->db));
                        } else {
                                g_set_error (error,
                                             TRACKER_DB_INTERFACE_ERROR,


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