提交 35a3be5b 编写于 作者: B Benjamin Pasero

storage - move error listener up

上级 08d82113
......@@ -510,14 +510,14 @@ export class SQLiteStorageImpl {
private prepare(db: Database, sql: string, runCallback: (stmt: Statement) => void): void {
const stmt = db.prepare(sql);
runCallback(stmt);
const statementErrorListener = error => {
this.logger.error(`[storage ${this.name}] prepare(): ${error} (${sql})`);
};
stmt.on('error', statementErrorListener);
runCallback(stmt);
stmt.finalize(error => {
if (error) {
statementErrorListener(error);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册