Exception handling for my project and terminate the same work flow

Hi Friends,

I have been trying to handle the exceptions in my project.
So i am just pasting here small piece of my project.
Suppose the sap.exe file is not present in the location or in the code i will give some wrong path then also it should handle the exception.

The piece of code:
path of exe is :
“C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe1”
image
image

when i run i got the below error

image

Thanks in Advance
Sonika

buddy are you using this within global exception handler scope, @Seem
if so take the try catch block out from that scope and use it as it is
buddy @Seem

Cheers

@Palaniyappan

Global exception handler - i have not used. :frowning:
But i was studying about it…

Also i got this link - https://studio.uipath.com/docs/global-exception-handler.

My project is too big. will this GEH can help me out with this.

Regards,
Sonika

1 Like

This could help you buddy @Seem

cheers

@Palaniyappan

I went through the link ,
I have my main project and i also added the GEH.
but from my main.xaml i am not able to enter in to GEH.
Also once i enter in to the handler.xaml , i want to terminate the main.xaml.

i understood the concept of GEH. Its good.

but at implementaion i am stuck

GlobalExceptionHandler.xaml (6.9 KB)
Main.xaml (22.4 KB)

Please help me

Sonika

Hi All,

I went through the following link:

It auto invokes the GH. and i did programmatically for my project
Well as i explained in the beginning that my application is throwing an error
image
And i also see that i my self should click on this continue button.

Well tomorrow it can throw any type of error , which i am un aware of it.
So how shall i handle it?

NOTE: I DONT WANT ANY MANUAL INTERVENTION.
The error may or may not appear
Please help me

Regards,
Sonika

Hi @Seem,

I found the cause of your error message.
You should remove Terminate Workflow from the catch block. It will work fine.
The purpose of try catch block is to catch any errors and end the workflow smoothly.
You shouldn’t be using terminate workflow here.

Regards,
Harshit Goyal

@harsh497

I have removed the “terminate workflow”.
Actually my process is too big.
I have just pasted a part of it. Well i just want to stop the process where i get the bugs. So how shall i stop the process(which have many sequences)

Regards,
Sonika

@Seem,

I can suggest two things here.

1st- You can define an out_Error argument in the beginning of each flow, assign it to false. If there is some error, you can catch it in try catch block, set out_Error argument to True in the catch block.
And after this sequence, you can check condition in the parent flowchart that if out_Error argument is False, proceed to the next step, otherwise, send an error mail notification. (You can create this send error mail notification workflow and reuse it in subsequent checks).

2nd- You can use Try catch in the child workflow and in case of any errors, you can use a throw activity with the exception message so that it gets caught in the parent workflow. Inside catch block of parent workflow, you can use Send email (with exception.Message in Body) to notify the concerned people.

Regards,
Harshit Goyal