what is retry in x++
-> A retry can be written in a catch block to jump back to the first line of code within the try block.
-> This can be used if the issue in the implementation can be fixed by code in the catch block.
-> Then, the try block will run again to give it a second chance to succeed.
****
-> Make sure that the retry does not cause an infinite loop.
Example:
try
{
//Run some code that might throw a numeric or other type of exception.
}
catch (Exception::Numeric)
{
info('Found a Numeric exception.');
}
catch
{
info('Caught an exception');
retry;
}
finally
{
// Executed no matter how the try block exits.
}
Comments
Post a Comment