Explain Try and Catch Block

try {
Execute function X;
Execute function Y;
}
catch
{
Execute this when any function fails: X or Y;
}
finally
{
Execute function Z regardless whether X or Y fails;
}

# Note: if a “break,” “continue,” “return,” or “exit” command is triggered inside this block, the block will immediately get out of scope.
Posted on Categories Codes

Leave a Reply

Your email address will not be published. Required fields are marked *