Author |
Message
|
nk |
Posted: Thu Oct 11, 2012 12:11 am Post subject: Error handling in case of TryCatch node |
|
|
Novice
Joined: 05 Jul 2012 Posts: 19
|
I'm processing CSV file. For doing so, i've storing all the records in the database and processing one by one. My requirement is that if processing of certain record get failed based on certain condition then we should throw exception to get email alert and all the remaining record should be processed.
For doing this i'm following pattern
FileInput -> compute(setting environment variables n for storing in the database) -> TryCatch -> Compute(for processing records) ->MqOutput
I'm able to processing all the records based on the conditions but whenever exception is generated at the catch part of TryCatch node, Root is coming as null and this is the reason why my ErrorHandler subflow(connected to catch terminal) is not generating email alert.
the Root what i'm getting from the Trace node connected to Catch terminal
Code: |
( ['GENERICROOT' : 0x122d14030]
(0x01000000:Name):Properties = ( ['MQPROPERTYPARSER' : 0x1208cdef0]
(0x03000000:NameValue):MessageSet = NULL
(0x03000000:NameValue):MessageType = NULL
(0x03000000:NameValue):MessageFormat = NULL
(0x03000000:NameValue):Encoding = NULL
(0x03000000:NameValue):CodedCharSetId = NULL
(0x03000000:NameValue):Transactional = NULL
(0x03000000:NameValue):Persistence = NULL
(0x03000000:NameValue):CreationTime = NULL
(0x03000000:NameValue):ExpirationTime = NULL
(0x03000000:NameValue):Priority = NULL
(0x03000000:NameValue):ReplyIdentifier = NULL
(0x03000000:NameValue):ReplyProtocol = 'UNKNOWN' (CHARACTER)
(0x03000000:NameValue):Topic = NULL
(0x03000000:NameValue):ContentType = NULL
(0x03000000:NameValue):IdentitySourceType = NULL
(0x03000000:NameValue):IdentitySourceToken = NULL
(0x03000000:NameValue):IdentitySourcePassword = NULL
(0x03000000:NameValue):IdentitySourceIssuedBy = NULL
(0x03000000:NameValue):IdentityMappedType = NULL
(0x03000000:NameValue):IdentityMappedToken = NULL
(0x03000000:NameValue):IdentityMappedPassword = NULL
(0x03000000:NameValue):IdentityMappedIssuedBy = NULL
)
(0x01000000:Name ):mcd = (
(0x01000000:Name):Msd = (
(0x02000000:Value): = 'none' (CHARACTER)
)
)
)
(0x01000000:Name):BLOB = ( ['none' : 0x1187a0690]
(0x03000000:NameValue):BLOB = X'' (BLOB)
)
)
|
Last edited by nk on Fri Oct 12, 2012 3:57 am; edited 1 time in total |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Thu Oct 11, 2012 1:11 am Post subject: Re: Error handling in case of TryCatch node |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
nk wrote: |
FileInput -> compute(setting environment variables n for storing in the database) -> TryCatch |
How did you process / propagate message in first compute node?
--
marko |
|
Back to top |
|
 |
rekarm01 |
Posted: Thu Oct 11, 2012 1:15 am Post subject: Re: Error handling in case of TryCatch node |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
nk wrote: |
FileInput -> compute(setting environment variables n for storing in the database) -> TryCatch -> Compute(for processing records) ->MqOutput
I'm able to processing all the records based on the conditions but whenever exception is generated at the catch part of TryCatch node, Root is coming as null and this is the reason why my ErrorHandler subflow(connected to catch terminal) is not generating email alert. |
When the message flow throws an exception, Root reverts to an earlier state; any changes between the point where the exception is thrown and where it's caught are undone.
It's not always necessary to throw an exception for every error condition. Why not use a Filter node or some form of PROPAGATE instead to test for the error condition, to route errors to an alternate path for email alerts? |
|
Back to top |
|
 |
nk |
Posted: Thu Oct 11, 2012 11:44 pm Post subject: Re: Error handling in case of TryCatch node |
|
|
Novice
Joined: 05 Jul 2012 Posts: 19
|
marko.pitkanen wrote: |
nk wrote: |
FileInput -> compute(setting environment variables n for storing in the database) -> TryCatch |
How did you process / propagate message in first compute node?
--
marko |
In the 1st compute node i'm just storing records into the databse and in the 2nd processing the records by storing into the Environment list and in the 2nd compute node itself propagating records(one by one) after processing. |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Thu Oct 11, 2012 11:50 pm Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
Hi,
I tried to ask do you propagate OutputRoot.BLOB.BLOB from the first compute -node to TryCatch node?
--
marko |
|
Back to top |
|
 |
nk |
Posted: Fri Oct 12, 2012 12:06 am Post subject: Re: Error handling in case of TryCatch node |
|
|
Novice
Joined: 05 Jul 2012 Posts: 19
|
[quote="rekarm01"]
nk wrote: |
FileInput -> compute(setting environment variables n for storing in the database) -> TryCatch -> Compute(for processing records) ->MqOutput
It's not always necessary to throw an exception for every error condition. Why not use a Filter node or some form of PROPAGATE instead to test for the error condition, to route errors to an alternate path for email alerts? |
I was talking abt the condition when exception occurs. Here we cant use PROPAGATE for the exception part because once i'll use, further record wont get processed albeit i'm using PROPAGATE for the correct output msgs.
@Marko: i'm not doing that in the 1st compute node. Instead doing it in the ErrorHandler subflow but it's null. Infact in the ErrorHandler subflow InputBody is null, when I've connected with the Catch terminal. |
|
Back to top |
|
 |
nk |
Posted: Fri Oct 12, 2012 3:55 am Post subject: Re: Error handling in case of TryCatch node |
|
|
Novice
Joined: 05 Jul 2012 Posts: 19
|
i found solution. thank you Guys for your support |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Fri Oct 12, 2012 8:23 am Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
And for the further readers what was your solution?
--
Marko |
|
Back to top |
|
 |
harry123 |
Posted: Tue Mar 26, 2013 12:03 pm Post subject: Re: Error handling in case of TryCatch node |
|
|
Newbie
Joined: 30 Oct 2012 Posts: 9
|
nk wrote: |
i found solution. thank you Guys for your support |
Hi NK,
I have the similar type of problem. Can you share the solution you have found for the problem.
Thanks,
Harry |
|
Back to top |
|
 |
|