slipshow icon indicating copy to clipboard operation
slipshow copied to clipboard

Exceptions thrown during undo are hidden and not logged to the console

Open meithecatte opened this issue 1 year ago • 1 comments

This makes for some confusing debugging

meithecatte avatar Mar 10 '25 18:03 meithecatte

Sorry, I filed this when I was very much in the middle of things, and now it seems that my initial assessment wasn't entirely accurate. I tested this with a very dirty

return {
    undo() {
        throw "meow";
    }
}

and it looks like only objects that aren't exceptions but are nevertheless thrown get swallowed up and hidden like this.

The original issue that lead to me trying this turned out to be a misunderstanding on my part, regarding how promises interact with the JavaScript event loop (resolving a promise doesn't immediately execute everything, but schedules it to be the next thing the event loop does, and so my implementation of "skip all pending sleeps and spam that until the animation finishes" didn't work).

meithecatte avatar Mar 11 '25 14:03 meithecatte