mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
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:
@@ -94,9 +94,10 @@ pub fn onWriteFail(
|
||||
const vm = jsc.VirtualMachine.get();
|
||||
const function = vm.rareData().postgresql_context.onQueryRejectFn.get().?;
|
||||
const event_loop = vm.eventLoop();
|
||||
const js_err = postgresErrorToJS(globalObject, null, err);
|
||||
event_loop.runCallback(function, globalObject, thisValue, &.{
|
||||
targetValue,
|
||||
postgresErrorToJS(globalObject, null, err),
|
||||
js_err.toError() orelse js_err,
|
||||
queries_array,
|
||||
});
|
||||
}
|
||||
@@ -116,7 +117,7 @@ pub fn onJSError(this: *@This(), err: jsc.JSValue, globalObject: *jsc.JSGlobalOb
|
||||
const event_loop = vm.eventLoop();
|
||||
event_loop.runCallback(function, globalObject, thisValue, &.{
|
||||
targetValue,
|
||||
err,
|
||||
err.toError() orelse err,
|
||||
});
|
||||
}
|
||||
pub fn onError(this: *@This(), err: PostgresSQLStatement.Error, globalObject: *jsc.JSGlobalObject) void {
|
||||
|
||||
Reference in New Issue
Block a user