This commit is contained in:
Ciro Spaciari
2025-09-08 18:28:10 -07:00
parent 8bf8b8e32f
commit 3be879682e
2 changed files with 9 additions and 13 deletions

View File

@@ -396,19 +396,15 @@ class PooledMySQLConnection {
this.queryCount = 0;
this.flags &= ~PooledConnectionFlags.reserved;
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);
throw e;
// notify all queries that the connection is closed
for (const onClose of queries) {
onClose(err);
}
const onFinish = this.onFinish;
if (onFinish) {
onFinish(err);
}
this.adapter.release(this, true);
}

View File

@@ -19,7 +19,7 @@ pub fn createMySQLError(
message: []const u8,
options: MySQLErrorOptions,
) bun.JSError!JSValue {
const opts_obj = JSValue.createEmptyObject(globalObject, 18);
const opts_obj = JSValue.createEmptyObject(globalObject, 0);
opts_obj.ensureStillAlive();
opts_obj.put(globalObject, JSC.ZigString.static("code"), try bun.String.createUTF8ForJS(globalObject, options.code));
if (options.errno) |errno| {