Hi All,
I am at facing problem for below case with try catch, can any one please help me.
public static void methodA()
{
try
{
ttsbegin;
… code 1 …
methodB()
… code 2 …
ttscommit;
}
catch
{
warning (“outermost catch”);
}
}
public void methodB()
{
while select tableX
{
try
{
ttsbegin;
… code 3 …
if (! tableX.field)
{
throw error (“no valid data for: %1”, tablex.number") ;
}
… code 4…
ttscommit;
}
catch
{
warning (“innermost catch”);
}
}
…code 5…
…code 6…
}
When methodB is called, if the validation failed for tableX data, when outer most catch() is calling, but here I want to call the inner most catch because I have to loop through all the records in the while loop in method B.
Note: if I comment the ttsbegin and ttscommit in methodA then outermost catch (catch in methodA) is never executing, because of this some data is not reversing when code (… code 2 …) throws an error.
Can any one please help me out to catch Inner catch I my case.
Thanks in advance,
Satish