workerd icon indicating copy to clipboard operation
workerd copied to clipboard

Reset uncaught exception handling after startup execution

Open mhart opened this issue 4 months ago • 2 comments

Fixes #5332

I've confirmed this keeps the stack for any uncaught errors during startup:

service main: Uncaught Error: wtf
  at worker.js:14:11 in recurse2
  at worker.js:9:3 in recurse1
  at worker.js:16:3 in recurse2
  at worker.js:9:3 in recurse1
  at worker.js:16:3 in recurse2
  at worker.js:9:3 in recurse1
  at worker.js:16:3 in recurse2
  at worker.js:9:3 in recurse1
  at worker.js:16:3 in recurse2
  at worker.js:9:3 in recurse1

Turning this off any earlier (eg at the end of the Script constructor) is too early:

service main: Uncaught Error: wtf
  at worker.js:14:10

I've also confirmed this improves performance of running scripts with throw patterns as per #5332

mhart avatar Oct 20 '25 11:10 mhart

@mhart was there something more you wanted to check before this lands or should I merge it?

kentonv avatar Dec 08 '25 23:12 kentonv

@mhart was there something more you wanted to check before this lands or should I merge it?

Ah yeah good point, this slipped off my radar, will look again today

mhart avatar Dec 08 '25 23:12 mhart