Click or drag to resize

DbServer.Error Method (Typed)

X#
Provide a method for handling error conditions raised during database processing.

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD Error(
	oError AS Error,
	symMethod AS SYMBOL
) AS USUAL
Request Example View Source

Parameters

oError
Type: Error
An Error object describing the error condition.
symMethod
Type: Symbol
The symbolic name of the method that originated the error.

Return Value

Type: Usual
Remarks
Tip Tip
This is an event handler and is automatically called by other methods; the developer does not normally need to call the DBServer:Error() method, but might want to replace or amend it.
All methods of the DBServer trap serious errors with a recover statement and send them to this method. Ordinary failures, such as locking conflicts or record-not-found, do not raise error conditions; they are simply indicated through failure return values. The standard Error() handling method fills in some more information about the errors and about the DBServer object that originates the error, sets the status value for the server object, and passes the problem to its client, if there is one, in its standard Error() handling method. If there is no client who wants to deal with the problem, the method passes it up the call stack by issuing a BREAK with the same Error object.
Tip Tip
If an error comes in while one is being handled, the Error() method immediately breaks.
Examples
The Skip() method uses the Error() method like this:
X#
1METHOD Skip(n) CLASS DBServer
2LOCAL oError AS USUAL
3BEGIN SEQUENCE
4RETURN (wWorkarea)->(VODBSkip(...))
5RECOVER USING oError
6SELF:Error(oError,#Skip)
7RETURN FALSE
8END SEQUENCE
See Also