From edec93a475fc4b96f8a21784d1a7d4774872bc6c Mon Sep 17 00:00:00 2001 From: Ciro Spaciari Date: Mon, 8 Sep 2025 19:25:15 -0700 Subject: [PATCH] test --- src/js/internal/sql/mysql.ts | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/js/internal/sql/mysql.ts b/src/js/internal/sql/mysql.ts index 8e4702944e..f41cb3c221 100644 --- a/src/js/internal/sql/mysql.ts +++ b/src/js/internal/sql/mysql.ts @@ -396,13 +396,19 @@ class PooledMySQLConnection { this.queryCount = 0; this.flags &= ~PooledConnectionFlags.reserved; - // notify all queries that the connection is closed - for (const onClose of queries) { - onClose(err); - } - const onFinish = this.onFinish; - if (onFinish) { - onFinish(err); + try { + // notify all queries that the connection is closed + for (const onClose of queries) { + onClose(err); + } + const onFinish = this.onFinish; + if (onFinish) { + onFinish(err); + } + } catch (e) { + console.log("onClose error", e, this instanceof PooledMySQLConnection, this, this.queries); + console.log("error", err); + throw e; } this.adapter.release(this, true);