Exception Handling Query

Shweta

Active Member
Hi All,

I have a query related to Exception Handling technique (Flow diagram shown below):

I have a scenario where, when I am running the below flow, its goes to first Exception, i.e, Exception1 > Recover Stage > Again goes to Exception2 block and throws the new exception.
Can anyone please advise me, on why its not again going to Recover Stage, as I am a bit confused in it.

Thanks!


View attachment 1547706470801.png
 

Shweta

Active Member
Also, please advise if both the exception will be diffused or none.. And if new exception will be thrown, then what will happen for Exception1.
 

sivagelli

Well-Known Member
Looking at the flow diagram attached, you are bubbling the exception by Exception2.
Exception still exists between Recover and Resume stages. Post Resume stage the exception is dead or diffused, unless there are any stages after resume stage that are inducing exceptions.

Few of the cases considered while we are between Recover and Resume stages is to retry the flow with a limiter or Marking the items in the queue with the exception details such as System exception or Business Exception, and so on.

Now, if you modify the flow and add Resume stage immediately after Recover stage and keep the remaining flow as is connecting to End stage, you can find that the Exception2 will be captured again by Recover2 stage and it goes in to an infinite loop. In this case, the Exception1 is diffused but not Exception2. If you need to diffuse Exception2 add another Recover stage and place a block around Exception2 and the Recover stage that is added.

As a best practice, it is always advised to use blocks to handle exception. Also, Exception handling has to be designed carefully.

Hope this makes good read!
 

Shweta

Active Member
Sorry, but I am still confused.

Using blocks, I am aware of the process.
I read in Foundation Training course, that there should be one Recover stage in page ..

So.. my point is that - After throwing first exception, it will go to Recover Stage and when again next stage is throwing exception, why its not showing the Exception 1 Detail. (which is still not diffused), instead its giving me Exception2 detail, as all this is happening before any resume stage encountered.
 

sivagelli

Well-Known Member
I read in Foundation Training course, that there should be one Recover stage in page ..
You can have as many as Recover stages as you want on a page when handled in blocks. If there are no blocks in place, use one recovery stage on a process and it captures all the exceptions on that page.

So.. my point is that - After throwing first exception, it will go to Recover Stage and when again next stage is throwing exception, why its not showing the Exception 1 Detail.
If you want re-throw Exception1 details, in the Exception2 stage check "Preserve..." check-box.
 

Shweta

Active Member
By checking Preserver checkbox, its working fine.

But i was confused, in when its throwing Exception2 and giving its details, its not going to Resume stage. So, due to that I believe, the first exception is also not getting diffused.
Am I correct?
 

sivagelli

Well-Known Member
But i was confused, in when its throwing Exception2 and giving its details, its not going to Resume stage. So, due to that I believe, the first exception is also not getting diffused.
Am I correct?
In the process of diffusing the Exception1 that has occurred, you encountered another exception (exception2). So, BP is showing you the details of Exception2.
 
Top