Skip to content

Commit

Permalink
R: fix 500 error bug
Browse files Browse the repository at this point in the history
  • Loading branch information
aki-0421 committed Apr 20, 2023
1 parent 1e152e5 commit a867a2d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cloudflare/fetchevent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})))
}

0 comments on commit a867a2d

Please sign in to comment.