NEW 243668
Error stack is incomplete for async call
https://bugs.webkit.org/show_bug.cgi?id=243668
Summary Error stack is incomplete for async call
Xidorn Quan
Reported 2022-08-08 06:29:03 PDT
Created attachment 461484 [details] testcase Please see the attached testcase. There is a series of async functions, c() calls b() calls a(), but if you open it on Safari, the stack shows: > throwError@async-error.html:4:18 > @async-error.html:8:13 > asyncFunctionResume@[native code] > @[native code] > promiseReactionJobWithoutPromise@[native code] > promiseReactionJob@[native code] which is not very useful. Firefox has a similar issue, but at least it doesn't show things from native code: > throwError@async-error.html:4:9 > a@async-error.html:8:3 Chrome has the best behavior that it can properly track across async frame: > Error > at throwError (async-error.html:4:9) > at a (async-error.html:8:3) > at async b (async-error.html:11:3) > at async c (async-error.html:14:3) Being able to track across async frame is important for knowing what is the right place to handle an error. Not being able to go across async frame means it is very hard to track the stack for any network errors.
Attachments
testcase (310 bytes, text/html)
2022-08-08 06:29 PDT, Xidorn Quan
no flags
Xidorn Quan
Comment 1 2022-08-08 06:33:59 PDT
I think Firefox had a project for this: https://bugzilla.mozilla.org/show_bug.cgi?id=981514 but it seems to be stalled currently.
Sam Sneddon [:gsnedders]
Comment 2 2022-08-10 15:58:53 PDT
Note that bug 163230 effectively implemented a bunch of this for Web Inspector.
Devin Rousso
Comment 3 2022-08-10 17:46:22 PDT
ive done a *lot* of work lately to fix this (and a few other things) =D - 252543@main added async stack trace capturing for `queueMicrotask` (when Web Inspector is open) - 252554@main 252693@main, 252914@main, and 253022@main removed internal functions (e.g. `promiseReactionJob`) from stack traces - 252630@main makes it so that sync stack traces shown in Web Inspector will now always include any async stack traces we currently don't capture async stack trace information when Web Inspector is not open, so i'll leave this bug open as consideration for doing that
Radar WebKit Bug Importer
Comment 4 2022-08-15 06:29:16 PDT
Note You need to log in before you can comment on or make changes to this bug.