cancel
Showing results for 
Search instead for 
Did you mean: 

Blue Prism Code Stage Throw Blue Prism Exception Type

JeremyFarmer
Level 2
Hi, 

I am curious if it is possible from a code stage to throw one of the defined Blue Prism exception types

34861.png
Currently if a code stage throws any exception e.g. 

```
throw new ArgumentException("My exception message here");
```

It comes up in Blue Prism as an Internal Exception 

> Exception: Internal - Could not execute code stage because exception thrown....

What I'd like to do is throw a specific Blue Prism exception so my exception handling can deal with that exception in the proper way. Is this possible?

Thanks!
1 REPLY 1

Rambo27
Level 8
Hi Jeremy ,

In code stage while catching the exception you can use customize you exception or you can use the 
Catch ex as Exception
ex.StackTrace 

This will popup specific error from the code block and from this you can later use choice stage to evaluation and use predefined exception types as per exception occurs or you can make some general things going to system exception or business exception

Please try , Call out if any help needed. 

Shikhar Mishra RPA Lead Infosys