I am trying to write good error handling for the connection to Sage 100 in VB.Net. I have the following code:
Dim pvx = New COMDispatch("ProvideX.Script")
Try
pvx.InvokeMethod("Init", Path)
Catch ex As Exception
Dim lastErrorMsg = pvx.InvokeMethod("LastErrorMsg")
console.writeline(lastErrorMsg)
End Try
Wanting to be able to catch issues such as invalid paths and network problems. What is the right way to catch / report those kinds of errors?