HOW TO CREATE EXCEPTION HANDLING

Dear Experts,

I need a solution.
just I completed successfully in Automation my project.
Incase during the execution time

Windows Shot Down, or System Restart, or Process Failed or Something happened in my process executing time .

then, I am going to write in excel sheet BELOW :
if process is executed properly then "SUCCESS"
if process is not executed then "UNSUCCESS"

How can I handle these kind of errors

Please help me to this ?

Thanks

1 Like

Use TyCatch activity, in catch part store value of exception in string and check if its blank than its success else unsuccess or failed

1 Like

Thanks for the response @syedabidraza

sorry I can’t understand this so can you explain me plz ?

image

in exception field what should I mention ?

image

Can I mention System.Exception for all kind of exceptions ?

Awesome
That’s actually a good approach where usually we send mail to the user that the process completed or not
But with excel is fine as well

So coming to the point
Put the whole sequence in the TRY Block of TRY CATCH activity
Where in the very beginning of the TRY block mention a assign activity like this
bool_error = False
And then place the set of activities in the TRY Block

And if any exception occurs it will go to CATCH Block and there as a first activity we can mention as bool_error = True
That is if error occur it will assign the Boolean variable as false

Then in FINAL block of try catch activity
Use a IF condition like this
** Not bool_error = True**

Now if this condition is false means no error and goes to THEN apart where place the excel application scope and insert the value as success or it goes to ELSE part where update as unsuccessful

Cheers @Abubakkar

1 Like

Thanks buddy @Palaniyappan

It’s working superb.
Should I mention anything here ?

image

Yah
System.Exception in common
Cheers @Abubakkar

1 Like

Just I want to check Unsuccess message
but,

my exception like this

How can I catch this error and send to the users ??

image

image

Could you help me plz

1 Like

Fine click that exception so that we will get to know the exception type
Based on that we can include that exception as well in catch and the same set of activities to update the excel

Cheers @Abubakkar

1 Like

Thanks ji @Palaniyappan

Just I want to show extract the what kind of error appeared on the screen and then write in text file to particular folder. that’s it.

1 Like

Then we can do that with assign activity like
str_excpetion = Exception.Message.ToString

Use this inside the catch block so that if any exception occurs we will
Get to know the error message on why it occurred

Cheers @Abubakkar

1 Like