From 6f3225979cb497db99381556adb7e42119b44ec3 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 20 Mar 2017 22:12:20 +0100 Subject: Select conversation on startup, placeholder for "No conversation selected", start services before UI --- qlite/src/row.vala | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'qlite/src') diff --git a/qlite/src/row.vala b/qlite/src/row.vala index de10751f..ed0552a0 100644 --- a/qlite/src/row.vala +++ b/qlite/src/row.vala @@ -53,6 +53,7 @@ public class Row { } public class RowIterator { + private Database db; private Statement stmt; public RowIterator.from_query_builder(QueryBuilder query) throws DatabaseError { @@ -60,6 +61,7 @@ public class RowIterator { } public RowIterator(Database db, string sql, string[]? args = null) throws DatabaseError { + this.db = db; this.stmt = db.prepare(sql); if (args != null) { for (int i = 0; i < args.length; i++) { @@ -68,11 +70,11 @@ public class RowIterator { } } - public Row? next_value() { - if (stmt.step() == Sqlite.ROW) { - return new Row(stmt); - } - return null; + public Row? next_value() throws DatabaseError { + int r = stmt.step(); + if (r == Sqlite.ROW) return new Row(stmt); + if (r == Sqlite.DONE) return null; + throw new DatabaseError.EXEC_ERROR(@"SQLite error: $(db.errcode()) - $(db.errmsg())"); } } -- cgit v1.2.3-54-g00ecf