cancel
Showing results for 
Search instead for 
Did you mean: 

Want to know Exception throw Differences

HarshithKumar
Level 4
Hello Everyone,

I hope Everyone is Safe.

I have been working on Blue Prism for a while now. I just had a doubt which If you could answer that would be of great help to me.

16901.png

16902.png


I have attached the above images for a better understanding. So If you see Img1 ->Exception thrown by Exception 2 will be caught by Recover 4.
But in Img2 - >Exception thrown by Exception 2 will not be caught by Recover 4 (will bubble up).

Could some Please help understand the logic behind this, please?

Thanks in advance.



------------------------------
Harshith Kumar
Graduate Engineering Trainee
Schneider Electric
------------------------------
8 REPLIES 8

John__Carter
Staff
Staff
Try ticking the 'Preserve...' checkbox in Ex2, I'd expect that to send it to Recover 4. Without the checkbox Ex2 is an new exception, in addition to the one cause by the divide by zero.

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------

Hi John,

this was my understanding too but it was the same result (bubble up to the caller without going to recover stage) unless you diffuse it with resume stage then throw new exception, and this time, it will be caught by recover 4
16879.png



------------------------------
Amador Yranon
------------------------------

Hi Amador/John,

Exactly my point!

So what way this works can someone please help me understand?

Thanks in advance.

------------------------------
Harshith Kumar
Graduate Engineering Trainee
Schneider Electric
------------------------------

Hi,

the difference is following:
1. scenario 1 - exception was triggered and caught by Recovery stage as you would expect. At this moment Blue Prism runs in Recovery mode and if any additional exception is triggered it is ignored (I believe now you already understand the difference).
2. scenario 2 - exception was triggered by division by zero and caught by Recovery stage which means Blue Prism is running in Recovery mode and until you fix this mode by Resume stage it will bubble up until it finds Resume or I guess the process will terminate as unhandled exception.

Regards,

------------------------------
Zdeněk Kabátek
Head of Professional Services
NEOOPS
http://www.neoops.com/
Europe/Prague
------------------------------

Thanks, Zdenek.

I agree​ with you Totally. In fact, that is my understanding as well. But I'd like to hear from Blueprism is it a bug or that's how it works.

Thanks in Advance @blue prism

------------------------------
Harshith Kumar
Graduate Engineering Trainee
Schneider Electric
------------------------------

Hi, Harshith,

this is definitely a feature as you don't want to end up in infinite loop triggering exceptions and consuming them by Recovery stage.

If you look at Blue Prism Process Template on the Main page you have Recovery Stage linked to the Notify Termination page and then Re-Throw exception. If it worked the way that it is consumed by Recovery stage it would be an example of the infinite loop. But as this feature is utilized - running in Recovery mode - the process will terminate and the Re-Throw exception will not be caught by Recovery stage.

I hope that I convinced you and you don't need to wait for confirmation from Blue Prism ;).

Regards,

------------------------------
Zdeněk Kabátek
Head of Professional Services
NEOOPS
http://www.neoops.com/
Europe/Prague
------------------------------

Hi Harshith I don't think it's a bug, I think that's how it works. The golden rule with exception handling is to make sure you only ever have one exception 'live' while in recovery mode. If you want to re-throw, then use the Preserve checkbox, or make sure to use Resume before launching the new exception.

Feel free to email the question with Support, asking them to seek the advice from the Product team.

------------------------------
John Carter
Professional Services
Blue Prism
------------------------------

Thank you so much @John Carter @Zdeněk Kabátek​​.

That was very helpful.

------------------------------
Harshith Kumar
Graduate Engineering Trainee
Schneider Electric
------------------------------