I am encountering an issue with the try-catch block in production. As you can see, my program follows a flow where each “block” represents a sequence containing a try-catch block. The intended behavior is that if an exception occurs within any block, the try-catch should handle it, allowing the subsequent block to execute as planned. For instance, if block 3 encounters an exception, block 4 should still proceed. While this works correctly in debug mode, running the robot in production mode causes it to skip all blocks in the diagram upon detecting an exception. The same behavior occurs when using the “continue on exception” function in the Debugging ribbon. Am I missing some configuration that would ensure proper functionality?
I discovered that the “continue on exception” button produces the effect, both in debugging mode and in production mode.
In other words, if it remains active in debug mode and is executed (Ctrl + F5), it seems to exhibit the same behavior.
You can follow some below steps:
Set proper Timeouts on UI activities
Add “Continue On Error” = False
Use Retry Scope if the element might load slowly
Make sure exception type is correctly caught
As well try putting log messages in between and check .
Hope this works for you!
I can see in your catch block you are using Log Message activity to log variable value. There is possibility that this activity is failing too (could be because of variable is null ?). In catch block log only exception message (exception.message
) then check if subsequent blocks are getting executed or not.
I wonder why it works correctly in “debug” mode but not in “run” mode.
Nonetheless, the issue seems to be related to the “Continue on exception” button, as disabling this button allows it to function properly in both modes.
Good day, I wish to inform you that the issue with the exception was evidently caused by a bug. For reasons unknown, it now functions correctly in both ‘Debug’ mode and ‘Execution’ mode.
Nonetheless, I extend my gratitude to @AkshaySandhu and @AkshaySandhu for their responses.
That’s great!
can you let us know how you resolved it ? like restarted/repair the Studio or you reinstalled Studio/any specific dependency etc.
I simply restarted my computer. I tend to leave it on for several days, often with the studio open as well… and I noticed that occasionally it glitches.