Error handling in Error Prone and Unstable Systems

after a lot of thinking on the post my actual question can be summed up with a single question.

What is the best way if an error occurs within a for each loop to document the error and continue on in the loop without killing the automation?

I have a “for each row in datatable loop” and within that loop a great number of types and kinds of errors can occur, through no fault of the automation.

When an error occurs I would like to be able to do some logging on the error, kill the application, navigate back to the beginning, and carry on with the next row.

most of the errors will be caused by unexpected screens popping up, screens failing to load properly, and the application i am automating being lukewarm garbage.

thank you Kindly in advanced for looking over this. any help or questions or suggestions would be appreciated.

I will leave the below for posterity. but isn’t necessary for the question above.

I am building an automation for an older electronic medical record system to create new visits and add some documentation on those visits. the build looks something like this. note: it is not an html or web based application, but the UI Explorer does give really good selectors 90% of then time. also based in the US for questions and comments about insurance.

bulk of the automation is
for each patient in table
create visit
document
add charge
record account number and charge succesful
loop back to the next patient

my issues are multiple

  1. the EMR is prone to hanging up, taking its time, and other odd issues.
    i have mostly resolved the above with retry scopes on problematic buttons

  2. incomplete patient demographics. the system REQUIRES certain key pieces of information match or be present for a new patient visit or it will throw “Fatal Edits”. insurance numbers etc, once this happens the options are. 1 fix the edits 2. kill the program, record errors, restart on next patient. i am handing this with a flowchart that does 2 and will eventually with updating the simple Fatal edits.

  3. Screen Hanging, just the programs screens kind of hanging up in weird odd moments. the system does this occasionally during normal use but the automation seems to aggravate the issue. right now default interactions seems to work the best. Not using windows messages or simulating clicks.

as an over all solution i think i am going to star using a lot more try catch, a feature i am not very familiar with maybe a try catch just with in the patient loop that will document the error, where and who it happened on. close the program, restart and move it back to the beginning then carry on with the next patient.

Hello @Jason_Dossett ,

From what I see in the description, if it was me, I am thinking to use the Reframework, where you can define Business exceptions/System exceptions.

Using those, you can create specific flows when you encounter a specific issue.

Additional to this, for sure I’ll use some Try/Catch where I know are activities with problems.

The Ref template, can restart the flow, if any specific SystemException appear.

It’s just an idea…

Vasile.

I have not used or heard about the Reframework. BUT from your description and three minutes on How to Use Enhanced REFramework to Implement UiPath Projects | UiPath it definitely like something worth trying. But just Being able to separate out application failures, business process errors, and errors from incomplete files would be a very big help.

Thank you so much!