fx-compat: Throw error if generator is passed to DB.executeTransaction()
This commit is contained in:
parent
03242e8984
commit
993320655e
1 changed files with 6 additions and 0 deletions
|
@ -466,6 +466,12 @@ Zotero.DBConnection.prototype.executeTransaction = async function (func, options
|
||||||
}
|
}
|
||||||
|
|
||||||
var conn = this._getConnection(options) || (await this._getConnectionAsync(options));
|
var conn = this._getConnection(options) || (await this._getConnectionAsync(options));
|
||||||
|
|
||||||
|
if (func.constructor.name == 'GeneratorFunction') {
|
||||||
|
throw new Error("Zotero.DB.executeTransaction() no longer takes a generator function "
|
||||||
|
+ "-- pass an async function instead");
|
||||||
|
}
|
||||||
|
|
||||||
var result = await conn.executeTransaction(func);
|
var result = await conn.executeTransaction(func);
|
||||||
Zotero.debug(`Committed DB transaction ${id}`, 4);
|
Zotero.debug(`Committed DB transaction ${id}`, 4);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue