fix(Bun.SQL) fix postgres error handling when pipelining and state reset (#22505)

### What does this PR do?
Fixes: https://github.com/oven-sh/bun/issues/22395

### How did you verify your code works?
Test
This commit is contained in:
Ciro Spaciari
2025-09-08 21:00:39 -07:00
committed by GitHub
parent e63608fced
commit 1e4935cf3e
4 changed files with 227 additions and 152 deletions

View File

@@ -60,7 +60,7 @@ pub fn createPostgresError(
message: []const u8,
options: PostgresErrorOptions,
) 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));
inline for (std.meta.fields(PostgresErrorOptions)) |field| {