ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Error Handling using nested try catch nodes

Post new topic  Reply to topic
 Error Handling using nested try catch nodes « View previous topic :: View next topic » 
Author Message
Harman
PostPosted: Fri Oct 23, 2020 3:28 am    Post subject: Error Handling using nested try catch nodes Reply with quote

Newbie

Joined: 22 Apr 2020
Posts: 9

Hi

Currently , my flows looks like

Subflow 1 : Input -> TryCatch -> Subflow2 -> Output

Subflow 2 : Input -> TryCatch -> HTTP -> Output

What is happening in my scenario is ,when HTTP results in 500 , the catch block in the Subflow2 handles the exception gracefully and the control goes to the Subflow1 .
Now the compute node in Subflow1 throws user exception, the control goes back to the Subflow2 in the catch block.

But I dont want this to happen , I want the user exception thrown in Subflow1 should be handled by the tryCatch in Subflow1 and not Subflow2 .

Please suggest if there is any way to achieve this scenario
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Oct 23, 2020 4:53 am    Post subject: Re: Error Handling using nested try catch nodes Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Harman wrote:
Now the compute node in Subflow1 throws user exception, the control goes back to the Subflow2 in the catch block.


Where's the compute note in Subflow1? Before or after the try/catch? Before or after Subflow2?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Harman
PostPosted: Fri Oct 23, 2020 5:02 am    Post subject: Reply with quote

Newbie

Joined: 22 Apr 2020
Posts: 9

@Vitor the compute node which may throw user exception is immediately after the Subflow2 .
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Oct 23, 2020 7:26 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Functioning as designed I'm afraid.

One possible solution would be for Subflow2 to rethrow any exceptions that are not HTTP related.

Someone will be along in a minute with a better solution.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
abhi_thri
PostPosted: Wed Oct 28, 2020 11:39 pm    Post subject: Reply with quote

Knight

Joined: 17 Jul 2017
Posts: 516
Location: UK

hi...As Vitor mentioned it is working as designed. Usually you are better off using a generic error handling logic (eg:- using a error subflow(s)) at a message flow level by connecting it to the Catch terminal of the input node. This allows you to build a consistent error handling framework across all your interfaces which can be changed/improved without modifying any functional interface specific logic.

Where specific error handling is required, eg:- inspecting Http/Soap errors you can add node specific error logic (eg:- for HttpRequest, SoapRequest nodes etc) by connecting the fault/failure terminals of the nodes to a common node/subflow.

This ensures that scenarios where extra error handling is requried are dealt there and then and all the remaining runtime or other errors across the interface is dealt by the default error framework.

When it comes to error handling it is always advisable to keep it simple where possible which allows you to reap the benefit in the long run.
Back to top
View user's profile Send private message
Harman
PostPosted: Thu Oct 29, 2020 4:52 am    Post subject: Reply with quote

Newbie

Joined: 22 Apr 2020
Posts: 9

Thank you @Vitor and @abhi_thri for your valuable inputs .
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Error Handling using nested try catch nodes
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.