Very advanced Error Handing Command we have in A2019 and explained in a clean and crisp way.. Great Work.. GoBeGreat
@sukhisonuhbk3 жыл бұрын
Hi Micah, Your videos are really helpful. I am working as a program manager and I also develop bots. In the tool that we are using during the execution, sometimes the error messages that pops up is a windows critical error message and the entire screen freezes. I have applied try and catch to handle exceptions. However, it does not work in this case. Right now based on the learnings i am customizing the error handling part by using if window exists. Please share your knowledge on how can we handle this. As the current solution does not work if the bot is running headless and the execution halts.
@Automationanywhere3 жыл бұрын
Hey Sukhi - thanks for your kind words. Checking for window exists is probably the best way to handle the presence of the error pop up. Alternatively, you could try to use Recorder to clone an object on the error message pop-up itself and verify that the object does not exist before continuing. Hope that helps!
@harshmehta29984 жыл бұрын
@AutomationAnywhere @MicahSmith I checked the Java docs for Try Catch Finally Block for Error Handling and Found that if there is no error in Try Block CASE : No Exception in TRY Block. Then the finally part will execute. So as per the video the bot will retry 3 times even if no exception is occurred. The solution would be to use the retry if else concept in the Catch Block Instead of Finally Block and Using Loop Break inside at the end of try block when everything ran as expected. Please let me know if I am wrong. I faced this issue when I integrated the above in production code.
@MicahDanielSmith4 жыл бұрын
Hey @Harsh - the code shown in the video is actually missing one part - which is to have a boolean "finished successfully" flag set at the end of the try block. With this in place, the finally block should check to see if the "finished successfully" (whatever you chose to call that variable) was set and can appropriately exit from the loop without running all 3 times. Hope that helps clarify.