[gom] gom: Improve SQLite error reporting



commit 795fea1ce97ac501a17debda5d347f7edbf2dd4b
Author: Mathieu Bridon <bochecha fedoraproject org>
Date:   Wed May 7 18:35:38 2014 +0800

    gom: Improve SQLite error reporting
    
    Telling the user that a statement failed because:
    
        Failed to execute statement: 19
    
    is not very useful.
    
    However, this is much better:
    
        Failed to execute statement: UNIQUE constraint failed: items.email
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729722

 gom/gom-command.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gom/gom-command.c b/gom/gom-command.c
index e32afca..0047bf8 100644
--- a/gom/gom-command.c
+++ b/gom/gom-command.c
@@ -330,7 +330,7 @@ gom_command_execute (GomCommand  *command,
       if (!(ret = (code == SQLITE_ROW || code == SQLITE_DONE))) {
          g_set_error(error, GOM_ERROR,
                      GOM_ERROR_COMMAND_SQLITE,
-                     "Failed to execute statement: %d", code);
+                     "Failed to execute statement: %s", sqlite3_errmsg(db));
       }
       return ret;
    }


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