mirror of
https://github.com/syumai/workers.git
synced 2025-03-10 17:29:11 +00:00
R: fix 500 error bug
This commit is contained in:
parent
1e152e5743
commit
a867a2dcbf
@ -28,5 +28,12 @@ func WaitUntil(ctx context.Context, task func()) {
|
||||
// see: https://developers.cloudflare.com/workers/runtime-apis/fetch-event/#passthroughonexception
|
||||
func PassThroughOnException(ctx context.Context) {
|
||||
exCtx := cfruntimecontext.GetExecutionContext(ctx)
|
||||
exCtx.Call("passThroughOnException")
|
||||
jsutil.AwaitPromise(jsutil.NewPromise(js.FuncOf(func(this js.Value, pArgs []js.Value) any {
|
||||
resolve := pArgs[0]
|
||||
go func() {
|
||||
exCtx.Call("passThroughOnException")
|
||||
resolve.Invoke(js.Undefined())
|
||||
}()
|
||||
return js.Undefined()
|
||||
})))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user