Retrieves error number (code).
An error code consits of the following three units:
severity
facility
error number
This function returns the error number part of it.
Kernel.bdh
GetErrorCode( in nError : number ): number;
The error number (code).
Parameter | Description |
---|---|
nError | Specifies the error code. |
dclfunc function PrintErrorStack var sError : string; sErrorNumber : string; sFacility : string; sSeverity : string; x : number; y : number; begin // get last error x := GetLastError(); sErrorNumber := String(GetErrorCode(x)); sFacility := String(GetErrorFacility(x)); sSeverity := String(GetErrorSeverity(x)); Print("Last Error: (Error Nr.: " + sErrorNumber + ", Facility: " + sFacility + ", Severity: " + sSeverity + ")"); Print(" = " + GetErrorMsg(x)); // get error stack x := GetFirstError(y, 0, 0, sError); while x <> 0 do Print("Stack: " + String(x) + "; " + sError + "; " + String(y)); Print(" = " + GetErrorMsg(x)); x := GetNextError(y, 0, 0, sError); end; end PrintErrorStack;
Last Error: (Error Nr.: 5, Facility: 5, Severity: 3) = SYSTEM: 5 - The handle is incorrect.