aboutsummaryrefslogtreecommitdiff
path: root/qlite/src/insert_builder.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-10-28 23:48:07 +0200
committerfiaxh <git@mx.ax.lt>2017-10-31 15:41:45 +0100
commitb9df78e4494879752e9e68dcc5d54e03fffe9467 (patch)
treed1c74fde4aedea42773bc411c557f2184003defa /qlite/src/insert_builder.vala
parentd9b91206c0291fa8aa58df572292784a4f8ff878 (diff)
downloaddino-b9df78e4494879752e9e68dcc5d54e03fffe9467.tar.gz
dino-b9df78e4494879752e9e68dcc5d54e03fffe9467.zip
Move DatabaseError handling into Qlite
Diffstat (limited to 'qlite/src/insert_builder.vala')
-rw-r--r--qlite/src/insert_builder.vala12
1 files changed, 6 insertions, 6 deletions
diff --git a/qlite/src/insert_builder.vala b/qlite/src/insert_builder.vala
index 91388f69..b66464a6 100644
--- a/qlite/src/insert_builder.vala
+++ b/qlite/src/insert_builder.vala
@@ -45,13 +45,13 @@ public class InsertBuilder : StatementBuilder {
return this;
}
- public InsertBuilder value_null<T>(Column<T> column) throws DatabaseError {
- if (column.not_null) throw new DatabaseError.ILLEGAL_QUERY(@"Can't set non-null column $(column.name) to null");
+ public InsertBuilder value_null<T>(Column<T> column) {
+ if (column.not_null) error("Qlite Error: ILLEGAL QUERY: Can't set non-null column %s to null", column.name);
fields += new NullField<T>(column);
return this;
}
- internal override Statement prepare() throws DatabaseError {
+ internal override Statement prepare() {
string fields_text = "";
string value_qs = "";
for (int i = 0; i < fields.length; i++) {
@@ -72,13 +72,13 @@ public class InsertBuilder : StatementBuilder {
return stmt;
}
- public int64 perform() throws DatabaseError {
+ public int64 perform() {
if (prepare().step() != DONE) {
- throw new DatabaseError.EXEC_ERROR(@"SQLite error: $(db.errcode()) - $(db.errmsg())");
+ error(@"SQLite error: %d - %s", db.errcode(), db.errmsg());
}
return db.last_insert_rowid();
}
}
-} \ No newline at end of file
+}