testing/javascript: Improve exec() after close() error

This commit is contained in:
Pekka Enberg
2025-08-06 08:07:15 +03:00
parent cda3375061
commit 9ae96838ab
2 changed files with 8 additions and 0 deletions

View File

@@ -190,6 +190,10 @@ class Database {
* @param {string} sql - The SQL statement string to execute.
*/
exec(sql) {
if (!this.open) {
throw new TypeError("The database connection is not open");
}
try {
this.db.batch(sql);
} catch (err) {