Debugging a try block

(Jean Christophe Helary) #1

I can’t find a way to check what happens when a try block fails, besides for removing the “try” / “end try” and stepping into the code line by line.

Is there a smarter way to do that?

(Mark Alldritt) #2

Yes, there is a better way.

If there is an on error block, you can put a breakpoint on a statement within the on error block.

Alternatively, you can turn on Break On Exceptions. This causes execution to pause at the point in your script that raises the exception.

There is also a button you can add to your toolbar to toggle this on and off.