Creates an error code using severity, facility, and error number within the facility as parameters.
Kernel.bdh
CreateErrorCode( in nFacility : number,
in nCode : number,
in nSeverity : number ) : number;
The created error code.
| Parameter | Description |
|---|---|
| iFacility | Specifies the module that can cause the problem for which you define the error code. |
| nCode | Specifies the error code that you want to create. |
| nSeverity |
Severity of the error that is raised if the verification fails. Can be one of the following values:
|
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;