Custom Exceptions

activities
studio

#1

How do we set click activity with a business exception directly?
As when we use click activity by default it throws a system exception ,but i want it to be a business exception and how do we create a custom exception and use that in the workflows?
Regards
A.Srish


#2

@srishsai

This might not be the better way, but still you can try like this.

You can use Click Activity inside TryCatch, When It throws any exception after Click , the Exception will be caught inside catch, there you set one variable, let us take boolException and set it to true inside Catch block. Outside Try Catch Block check whether boolException is true or false, If true then Use Throw Activity to throw the Custom Exception.

Regards,
Mahesh


#3

Hi @MAHESH1,

Thanks for your reply ,but i don’t think so this is the best practice to do it,
i am expecting Uipath to put in the properties of each activity ,so that user have open option to select the exception or to give custom exception, as blue prism has the way to do it in the activities itself.

Another Query–can you please tell me how do we create custom exception?


#4

@srishsai

you can throw the exception by using Throw Activity.

Regards,
Mahesh


#5

Hi @MAHESH1,

we can only throw the type of exceptions which are defined by .Net like system exception /business rule exception/ io exception etc ,but not the custom exceptions

my question was where do we have an option to create custom type exceptions apart from the defined .NET ones