How send email to user when exception is occurred

Hi all ,

I am using REF for my process…
So here I have a login page and then go to portal and download the file from portal it is in the form of CSV and then i need to convert into Excel…and then upload the excel data into orchestrator queue…

It is simple dispatcher…

So I have two exceptions

1)Login url is not working

2)Login user credentials exception.

If any exception is occurred then it needs to go to end state…

And i need to send the exception mail through send outlook email activity…

So everything is needs to put the exception mail message in the end state

Could you please help me regarding this how to use the send email activities and everything is needs to be taken from Configuration file…

there are transitions will decide where next flow will go , if any system exception happen as per transition it will end the process so there you have to use your mail activity


click on system excpetion

use send mail message activity there where i mentioned

2 Likes

Hello @chandolusathi.kumar ,

Better way to send exception email if any exception occurs in Init state would be
Use Try catch block for Init all applications, so if URL is not working or entered credential fails catch the exception in catch block and use Send out look mail message to send the exception email. Then re-throw the exception so process flow can continue to End Process.

More about the Send Out look mail message can be found here :

Thanks,
Rohith

1 Like

You mean just delete the existing log messages

And take the send outlook mail message right…

So I need to send the multiple exception based on the exception

Just help me

Thanks regards
Sathish

1 Like

dont remove log message just drag and drop before that log message

yes you can do this for process transaction state also there one transition from process transaction for system exception there also you do same

I am just trying to explain you that this is Dispatcher…

I am not using get transaction state…

So just logging into some page and download the file from portal…

So I need to send the exception mail if the url is not working or else credentials is. Not working or else the file is not downloading or else any unknown exception…

So log in to page in the initial state

Then proces state downloaded the file and convert into Excel…

If any exception is occurred then need to send the mail to user…

1)log in url not working
2) credentials not working
3)file is empty
4) unknown exception

So please help how to get the value from configuration file uipath

Like

Hi team,

Bot encounters the some error

Error:Login url is not working

Thanks,
Uipath robot.

You can surround your login workflow with try catch then add business rule exception for each type of exception and throw appropriate exception from config for each type of business exception. Which exception is already known to you you can treat them as business exception and unknown exception as system exception.

Then in InitAllsettings surround with try catch and add rethrow activity in catch block as below

Then in RE framework SystemException transition you can add as below


Subject : if(SystemException IsNot Nothing,SystemException.Message,BusinessException.Message)

Body: if(SystemException IsNot Nothing,SystemException.Message,BusinessException.Message)

1 Like

Hi @sanghamitra_nayak

First of all thank you for your work…

So i am using reframework with initialisation and process state and end state

So here from initialisation State 3 transitions are there

  1. system exception
  2. business rule exception
  3. success

Success then go to process state

System exception then go to end state send the email to user whatever the exception we got

Similarly for business rule exception go to end state and send email to user regarding exception

So then go to process state from this also we have 3 transitions

Success
System exception
Business rule exception

Everything is goes good it goes to end state and send email to user process done successfully

If any exception is raised then needs to be inform to user through email…

I think you got the idea what exactly i am trying to explain…

So everything I am Taking from configuration file…

So here for example url is not working i need to send system exception

Or if credentials not working then needs to send business rule exception

Or else if any exception occurred like unknown exception i need to inform user through email

So where I need to use the send email activities and how to get the data from the config file for each exception…

Thanks regards
Sathish Kumar ch

1 Like

Hi @chandolusathi.kumar , here attaching one sample workflow how you can handle , kindly check below details

  1. Login.xaml (Handled only URL not working similarly you can built other exceptions)
  2. System Exception transition
  3. InitAllSettings
  4. End Process

UiPathRobot.zip (988.5 KB)

Let me know in case of queries or doubts

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.