What is the recommended way to handle errors and successfully close connections such as TCP/IP communication or a connection to a database.
In a text based language I would typically do the following:
Connection myConnection.
Try
{
myConnection.Open();
myConnection.DoStuff();
}
Catch( someError)
{
}
Finally
{
myConnection.Close();
}
It is not clear to me in LabVIEW if I pass the error to the close connection if that VI will run.
IE)
or
Ideally when dealing with the error I would like to return my program back into a known state which in many cases is a closed connection.