How can i throw a particular required exception in pega robotic automation?

I just wanted to throw a particular exception when some condition met. How can i achieve this?

@ShreeHarshaN16839089 This is a new one. You can easily catch a specific exception*, but throwing one is not something I have ever had to do in an automation. I believe the only way to do this is with a script. You can define the exception in the script and then throw it there. In your automation you would call the script which would throw the exception and then presumably, you’d catch it in whatever automation ultimately called this one.

*Since this custom exception is defined inside the script, you can’t really catch it specifically. Normally, you’d do that by clicking the plus icon on the catch block, but that won’t work here since it will have no way of knowing about the new exception you have defined in the script. You can catch it generically though and then check it to see if it is your exception type or a different one and handle them differently if necessary.