Catch more sqlite errors.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4182 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
90b513d070
commit
8e1461b3f1
@ -440,6 +440,11 @@ static void _tf_ssb_sqlAsync_work(uv_work_t* work)
|
||||
}
|
||||
}
|
||||
}
|
||||
sql_work->result = r;
|
||||
if (r != SQLITE_OK && r != SQLITE_DONE)
|
||||
{
|
||||
sql_work->error = tf_strdup(sqlite3_errmsg(db));
|
||||
}
|
||||
_tf_ssb_sql_append(&sql_work->rows, &sql_work->rows_count, &(uint8_t[]) { 0 }, 1);
|
||||
sqlite3_finalize(statement);
|
||||
}
|
||||
@ -516,7 +521,7 @@ static void _tf_ssb_sqlAsync_after_work(uv_work_t* work, int status)
|
||||
tf_free(sql_work->rows);
|
||||
|
||||
JSValue result = JS_UNDEFINED;
|
||||
if (sql_work->result == SQLITE_OK)
|
||||
if (sql_work->result == SQLITE_OK || sql_work->result == SQLITE_DONE)
|
||||
{
|
||||
result = JS_Call(context, sql_work->promise[0], JS_UNDEFINED, 0, NULL);
|
||||
tf_util_report_error(context, result);
|
||||
|
Loading…
Reference in New Issue
Block a user