Handle Exceptions |
Scroll |
When an error occurs during the execution of a method (e.g. invalid input parameters, array index out of range, bad network connection, etc.) an exception is thrown. The Thereforeā¢ API uses the IErrorInfo interface to report exceptions to the client. Wrap potentially throwing methods in a try-catch block and provide appropriate error handling for the various exceptions. The API Reference provides information which methods throw exceptions and under what conditions these exceptions may occur.
The Thereforeā¢ API Reference contains exception listings for most methods and some properties.
These listings include:
They do NOT include:
It is therefore important to note that the exception listings in the reference are incomplete and the absence of an exception listing does NOT imply a no-throw-guarantee. |
Visual Basic Imports Therefore.API '...
Dim server As New TheServer Try server.Connect(TheClientType.CustomApplication) Catch e As Exception System.Windows.Forms.MessageBox.Show(e.Message) End Try C# using Therefore.API; //...
TheServer server = new TheServer(); try { server.Connect(TheClientType.CustomApplication); } catch (Exception e) { System.Windows.Forms.MessageBox.Show(e.Message); } |