Exception Location

studio
exception
debug

#1

I use a try catch to capture the exception of my flowchart, but how can I locate the error activity when error was caught? Any solutions for this? thanks


#2

@rudy,

Exception.Message gives you the Message of the Exception
Exception.Source gives you activity where exception happened

References:

  1. How to Capture an Exception
  2. Try Catch Printing Exception Source
  3. Many More…

Regards,
Dominic :slight_smile:


#3

Thanks Dominic,
I tried the solution you given, but actually it did not show the display name of activity, just “UiPath.Core.Activities” given. any suggestion for this ? thanks.


#4

@rudy, Can you share screenhsots ? Actually it should.

Regards,
Dominic :slight_smile:


#5

Dominic, as you seen on the screen shot. actually the second activity will lead to error because I did not give a correct selector, but the debug result do not show its display name at all.


#6

@rudy, Sorry there is catch here,

Reference : Try Catch Printing Exception Source

Regards,
Dominic :slight_smile:


#7

Dominic, I think this is not so a good design, base on this, I have to create at least two workflows, even I just want to create a very simple robot. Many thanks for your comments.


#8

Hi @rudy,

if you get exception in try block you cant get the activity name, so use only on try catch block for entire project(in main/starting xaml alone use the try catch block)

In main/starting xaml alone use try catch block inside you call another xaml file invoke other xaml file.(so the entire project only one try catch block need to use so only you can get the activity name.

Regards,
Arivu


Exception Handling example
#9

@rudy, you needn’t to use two workflows. Point here is If you use Try catch with Invoke Workflow activity then you can catch the activity name with exception.Source

Regards,
Dominic :slight_smile:


#10

Hi Arivu, now I have a project which have to download information from multiple business systems. For each system, I want to create a xaml file so that I can get the result via out-arguments, and if failed in downloading, the robot need to write the running log. but exception may be given from any xaml files, if I want the robot to write the log correctly, it is difficult to get all the exception data from main xaml file.


#11

Hi @rudy,

So you can create another main xaml file for download your file,invoke there another xaml file, in try Exception get the error message and store it in out-arguments and get you can track it.

Regards,
Arivu