This function can be used to raise an error.
Kernel.bdh
RaiseError( in nErrorCode : number, in sMessage : string optional, in nCustomSeverity : number optional := SEVERITY_ERROR );
Parameter | Description |
---|---|
nErrorCode |
Specifies the error code that you want to raise. Specify 0 to refer to the last error. The following predefined error codes exist:
Custom error codes can be created with the CreateErrorCode function. |
sMessage | Specifies the message for the raised error. Optional parameter. |
nCustomSeverity |
Custom severity of the problem. Can be specified if the error should not use the standard severity for the specified error code (optional parameter).
|
dcltrans transaction TMain var hIiop0 : number; begin IiopObjectCreate(hIiop0, "IDL:Object:1.0", "1.2", "someserver", 12345, "key", 3); IiopRequest(hIiop0, "ReturnNoData"); IiopGetBoolean(hIiop0); // generates an "Out of data" error. end TMain; dclevent handler OnError <EVENT_RAISE_WARNING> begin // catch "IIOP 21 - Out of data" and report a user friendly error message if GetLastError() = CreateErrorCode (FACILITY_IIOP, 21, SEVERITY_ERROR) then RaiseError(0, "IIOP stream parsing error.", SEVERITY_ERROR); else throw; end; end OnError;