Nested try catch isn't working

steps:

  1. nest try catch blocks
  2. put a error block in the nested one
  3. make sure you handle the error on the top most try block

This is similar to what happens when making a “JavaScript enabled” block. Here’s what solved that issue.

Ringify it and put it in a run block. Hope this helps!

This is something similar to what it should look like:

If the “run” block don’t work try “launch”

This bug occurs because Snap*!* needs time to process the “if error” block before running the errored block. Although I may be a bit off because I’m not the developer of snap. @bh can probably explain this better than I can

umm, this is what I was talking about, the nesting breaks it

Ohh, sorry I misunderstood the problem. I’m not sure about that bug, never seen it before! Sorry

Have you tried changing the name of one of the upvars from ERROR to something else?

I have a feeling I know why this is happening. My guess is how it works.

After running the try/catch stuff, it has to reset the error. This looks to be a global system, so if one try/catch block resets it while it’s already in a try/catch block, then it’s already reset for the parent try/catch block while it’s still executing, meaning it won’t work.

yes


Yes, every completed try block disarms any other pending try/catch (in the same script) either internally as a part of the error handler or explicitly by extension.err_reset().