[epiphany/gnome-3-18] sqlite-connection: Do not ignore errors when executing commands



commit dde0b2b576cb811dd10afe4f25e26fe813ce0269
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Tue Feb 14 22:55:37 2017 -0600

    sqlite-connection: Do not ignore errors when executing commands
    
    This file is so careful to handle errors properly everywhere EXCEPT the
    point where actual SQLite commands are executed. The history database is
    pretty much totally broken right now; having error messages would be
    helpful thank you!

 lib/ephy-sqlite-connection.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/lib/ephy-sqlite-connection.c b/lib/ephy-sqlite-connection.c
index b8d46c6..3955d76 100644
--- a/lib/ephy-sqlite-connection.c
+++ b/lib/ephy-sqlite-connection.c
@@ -114,8 +114,12 @@ ephy_sqlite_connection_execute (EphySQLiteConnection *self, const char *sql, GEr
     set_error_from_string ("Connection not open.", error);
     return FALSE;
   }
-  
-  return sqlite3_exec (priv->database, sql, NULL, NULL, NULL) == SQLITE_OK;
+
+  if (sqlite3_exec (priv->database, sql, NULL, NULL, NULL) != SQLITE_OK) {
+    ephy_sqlite_connection_get_error (self, error);
+    return FALSE;
+  }
+  return TRUE;
 }
 
 EphySQLiteStatement *


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