class A
{
public void B()
{
System.Exception ex;
try
{
new ClassC().process();
}
catch (ex)
{
... do something with ex ...
}
return '';
}
}
class ClassC()
{
public void process()
{
try
{
throw error("Test error");
}
catch (Exception::Error)
{
container infoData = infolog.infologData();
str errorTxt;
for (int i = 1; i <= conLen(infoData); i++)
{
container internalInfoData = conPeek(infoData, i);
if (errorTxt == "")
{
errorTxt = conPeek(internalInfoData, 2);
}
else
{
errorTxt += ";" + conPeek(internalInfoData, 2);
}
}
throw error(errorTxt);
}
}
}
Class A
{
public str B()
{
try
{
......
classC = new classC();
D = classC.process();
}
catch (Exception::CLRError)
{
.......
}
catch (Exception::Error)
{
.......
}
return B;
}
}
Class classC()
{
public str D()
{
try // 1st-level try
{
......
salestable.insert();
while select lines
{
try
{
........
salesline.insert();
}
catch (Exception::Deadlock)
{
if (xSession::currentRetryCount() >= #RetryNum)
{
throw Exception::Deadlock;
}
else
{
retry;
}
}
catch (Exception::UpdateConflict)
{
if (appl.ttsLevel() == 0)
{
if (xSession::currentRetryCount() >= #RetryNum)
{
throw Exception::UpdateConflictNotRecovered;
}
else
{
retry;
}
}
else
{
throw Exception::UpdateConflict;
}
}
catch(Exception::DuplicateKeyException)
{
if (appl.ttsLevel() == 0)
{
if (xSession::currentRetryCount() >= #RetryNum)
{
throw Exception::DuplicateKeyExceptionNotRecovered;
}
else
{
retry;
}
}
else
{
throw Exception::DuplicateKeyException;
}
}
catch (Exception::Error)
{
container infoData = infolog.infologData();
Str1260 errorTxt;
for (int i = 1; i <= conLen(infoData); i++)
{
container internalInfoData = conPeek(infoData, i);
if (errorTxt == "")
{
errorTxt = conPeek(internalInfoData, 2);
}
else
{
errorTxt += ";" + conPeek(internalInfoData, 2);
}
}
errorMessage = errorTxt;
throw Error(errorMessage);
}
} // end while select
} // end 1st-level try
catch (Exception::Deadlock)
{
if (xSession::currentRetryCount() >= #RetryNum)
{
throw Exception::Deadlock;
}
else
{
retry;
}
}
catch (Exception::UpdateConflict)
{
if (appl.ttsLevel() == 0)
{
if (xSession::currentRetryCount() >= #RetryNum)
{
throw Exception::UpdateConflictNotRecovered;
}
else
{
retry;
}
}
else
{
throw Exception::UpdateConflict;
}
}
catch(Exception::DuplicateKeyException)
{
if (appl.ttsLevel() == 0)
{
if (xSession::currentRetryCount() >= #RetryNum)
{
throw Exception::DuplicateKeyExceptionNotRecovered;
}
else
{
retry;
}
}
else
{
throw Exception::DuplicateKeyException;
}
}
catch (Exception::Error)
{
container infoData = infolog.infologData();
Str1260 errorTxt;
for (int i = 1; i <= conLen(infoData); i++)
{
container internalInfoData = conPeek(infoData, i);
if (errorTxt == "")
{
errorTxt = conPeek(internalInfoData, 2);
}
else
{
errorTxt += ";" + conPeek(internalInfoData, 2);
}
}
errorMessage = errorTxt;
throw;
}
return D;
}
}
André Arnaud de Cal... 291,861 Super User 2024 Season 2
Martin Dráb 230,540 Most Valuable Professional
nmaenpaa 101,156