Class Name: HTException
Scope: Public - Unrestricted
The HTException Object is a utility object used across all of the SQL API objects to indicate to the programmer whether an error condition exists or was encountered after an operation or method call. It is a public class object which means that you can also use it in your own applications if you like.
Object Name: HTException Scope: Public - Unrestricted
Example (Visual Basic):
Dim x As New HTException With x 'I can set an exception like this .SetException("This is the Error", "MyMethod()", 333) 'I can clear the exception like this .Clear() 'I can copy an exception like this Dim y As HTException = x.Copy() 'I can show an exception like this MessageBox.Show(y.ExtendedErrorMessage, "Error") End With
Public Methods:
Clear() - Clears the object Copy() - Returns a copy of the object SetException() - sets the properties of the Exception object with 4 different implementations: 1. SetException(strMessage As String) 2. SetException(strMessage As String, strMethod As String) 3. SetException(strMessage As String, strMethod As String,intExceptionNumber As int32) 4. SetException(oException As HSQLException) - Sets the properties from another object
ReadOnly Properties:
ExceptionMessage - String ExceptionMethod - String ExceptionNumber - Int32 ExtendedErrorMessage - String - The 3 Exception Properties above in a string with Environment.NewLine between. HasException - Boolean Indicates whether the object contains an error message.
|
You will find that all of the complex objects in the SQL Engine API have a common Exceptions interface that implements the HTException Object in the exact same way for every object. Whenever possible we try to avoid having the API DLLs actually THROW a system exception, opting instead to trap system exceptions and place error information into a LastException property on each object. The Exceptions properties and methods will be common throughout every class object that subscribes the Common Exceptions Interface.
Common Exceptions Interface Properties and Methods for all objects that subscribe.
LastException (ReadOnly) - HTException Object
LastError (ReadOnly) - String - Echos the ExceptionMessage property of the LastException.
ClearErrors() - Calls the Clear() method of the LastException object.
IsError (ReadOnly) - Boolean - Echoes the HasException property of the HTException object IE: Indicates whether there is an exception by evaluating the LastError property ( LastError.Length > 0)