Posted On April 2, 2019

Explain Try and Catch Block

kimconnect 0 comments
blog.KimConnect.com >> Codes >> 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.

Leave a Reply

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

Related Post

Python: Package Installer for Python (PIP)

This comes preinstalled with Python 3.4 or higher. Similar to the Microsoft PowerShell Gallery, Python.org…

Basic HTML and HTML5: Nest Many Elements within a Single div Element

<h2>CatPhotoApp</h2><main><p>Click here to view more <a href="#">cat photos</a>.</p><a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying…

PowerShell: Create and Edit SMB Shares

# Create SMB Share $sharePath='C:\testshare' $accessList="$env:USERDOMAIN\Domain Admins","NT AUTHORITY\Authenticated Users" $shareName=split-path $sharePath -leaf mkdir $sharePath New-SmbShare…