Error handling in UiPath

Hi Everyone,

I am trying to implement a project on UiPath but I wish to know the error handling mechanism in UiPath:

  1. How and where is the error generated in UiPath upon implementation?

  2. How can I track/ monitor the errors?

  3. Where can I find the logs for error generated?

  4. Does UiPath report errors generated by application which is automated using UiPath?

  5. How can I trace the source of error?

  6. Where can I find the logs for error?

  7. How can I report the error to the end user in both attended and unattended cases?

Please advise.

1 Like

Answers to your questions -

  1. Errors or exceptions happens at anytime in the UIPath depending on the function of robot like interacting applications, entering data into text boxes, clicking elements (checkbox, radio buttons etc.,), opening applications and other activities too. Some exceptions can be predicted and some exceptions happens at the run time. How and where depends on how well the robot is robust (can handle all possible exceptions - which is an ideal case).

  2. You can track the exceptions/errors using try/catch block. The exception object contains all the information related to the error, source of the error and other details too.

  3. By using the logging level in UIPath you can find all information related to robot. You can use Log Message Activity also in UIPath to log the error information which contained in the exception object.

  4. Reporting errors can be done by sending an email with the attachment “log file” or body of the email with error information. It is a user responsibility how to report the errors to the end-user/developer.

  5. As I told earlier, exception object contains the source of error. But it is important to uniquely name the activities in the workflow for better understanding of where the error occurred.

  6. Explained in point 3.

  7. Explained in point 4.

Regards,
Karthik Byggari

1 Like

@KarthikByggari @Rishi1 @Manjuts90 @nadim.warsi @loginerror @Alex_Cross @Anders_Kink @NicholasPwi

@KarthikByggari,

On your reply to 1. By how and where, I mean where will I be able to view those errors? In orchestrator or somewhere else. where are the errors stored and how can I debug them?

On your reply to 2. Can the end user see the exceptions during run time, if yes how and where he will be able to view them?

On your reply to 3. Where can I or the end user find the logs? In which folder or on orchestrator?

On your reply to 4. Does the user always have to open SQL or Elastic search for logs)? Do I need to design a process following logging to send an email to the end user?

On your reply to 5. How will the end user be notified about the source of error? where can he see it on what platform?

On your reply to 7. Is there any difference in error generation and reporting in attended and unattended case? If yes, how the error is reported to the end user on what platform/ file/ directory?

Also, 8. what is the best practice to capture logs in UiPath?

  1. Can you give me an example on how an user can be notified on error generated by robots in production environment?
  1. Assuming you have tested your bot successfully, and put it “live” then any errors which occur will be viewable in Orchestrator in the Jobs tab. The error line will contain some information, but if you use the Log activity when designing your process you will be able to put more information into the logs. Imagine a 5 step process where you have a Log activity before each one (“Starting step 1, scraping data”, “Starting Step 2, pasting into Excel”…) and you see it errors after that second log, you will know the pasting into excel is causing an error. Does that make sense? You can debug back in Studio when you head back to the code and confirm selectors and process etc, there is a debug feature which allows you to work through your process slowly.
    Assuming you have yet to put this live, the logs will show in the Output panel in Studio, otherwise the fix process will be the same.

  2. Assuming you want them to see any exceptions as they’re occurring, not just get notified shortly after, if they were to log into Orchestrator they would be able to see the Job logs. I would not recommend this, it is far better practice to set up Try/Catch blocks where the Catch will email them if there’s an exception. An example I have is where I am trying to download 10 reports from our finance system, and if it is not able to download them all (it looks in the directory they should be saved in to see if all present) then the Catch will email the process owner, copying me in, to say it didn’t work. We can then work from there, by me checking the logs as mentioned in step 1 above.

  3. Orchestrator if the bot is Live, Studio if in Production.

  4. If you wish to use an external service for logging, then they would need access. You WOULD need to design a component to email end users in the event of an error, this is simple, there is a variety of actions within UiPath, such as Send SMTP mail, which can achieve this, and you are able to attach log messages to this email, so the users are aware of any issues which the bot has faced. Theoretically you could even attach the logs of the entire run to the email so they would receive an email regardless, showing every step having performed as expected, or it stopping where the error occurred.

  5. Similar to before, this comes down to whether you email the end user (and include detail in the email) which is preferred method, OR if you want to give them access to Orchestrator (I personally would not recommend this, as they don’t need it)

  6. You’re happy with, but I’m including to keep numbering easier.

  7. There is no difference I am aware of between the two in terms of error handling - it all comes down to how you set them up. If you have a try/catch block in both which emails the exception, then both will email the exception. Logs will also be stored in Orchestrator.

  8. Using the Log message activity throughout your process is good practice, as it gives description to what is occurring so the developer/orchestrator can check the detailed progress on Orchestrator.

  9. I have attached a screenshot showing the Try/Catch block I mentioned above. In the Try section I have the process to download all the reports, and you can see in the Catch section I have an email and log activity - which email the Process Owner and create a log in Orchestrator, respectively. This is a simple example, with a single source of error, and I have a few of these throughout my process, as this will allow the Process Owner (End User) to know where and why the error occurred.
    image

I hope this helps, any more questions let us know :slight_smile:

5 Likes