Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
RTErrors


NAME

RTErrors - handling of runtime errors

SYNOPSIS

CONST case = 1;         (* attempt to find case failed *)
CONST return = 2;       (* function does not return any value *)
CONST range = 3;        (* index out of range *)
CONST typeguard = 4;    (* failure of type guard *)
CONST conversion = 5;   (* conversion error *)
CONST crend = 6;        (* RETURN of coroutine *)
CONST assertion = 7;    (* assertion failed *)
CONST errorcodes = 8;


TYPE Name = ARRAY 32 OF CHAR; TYPE Event = POINTER TO EventRec; TYPE EventRec = RECORD (Events.EventRec) errorcode: INTEGER; (* one of case..assertion *) val, (* defined for range and conversion *) limit: LONGINT; (* defined for range *) (* valid only if errorcode # crend: *) moduleName, procedureName: Name; lineNumber: LONGINT; END; VAR error: ARRAY errorcodes OF Events.EventType; VAR errors: Events.EventType; (* catches all runtime errors *) VAR errormsg: ARRAY errorcodes OF Events.Message;

PROCEDURE CaseError(moduleName, procedureName: ARRAY OF CHAR; lineNumber: LONGINT); PROCEDURE NoReturn(moduleName, procedureName: ARRAY OF CHAR; lineNumber: LONGINT); PROCEDURE TypeGuardFailure(moduleName, procedureName: ARRAY OF CHAR; lineNumber: LONGINT); PROCEDURE RangeError(limit: LONGINT; val: LONGINT; moduleName, procedureName: ARRAY OF CHAR; lineNumber: LONGINT); PROCEDURE ConversionError(val: LONGINT; moduleName, procedureName: ARRAY OF CHAR; lineNumber: LONGINT); PROCEDURE CoroutineReturn; PROCEDURE FailedAssertion(code: INTEGER; moduleName, procedureName: ARRAY OF CHAR; lineNumber: LONGINT);

DESCRIPTION

RTErrors serves as interface between the runtime system and Events and thus allows customized runtime error handling.

All procedures raise errors and error[code]. The default reaction for these events is Events.default (program termination with core dump). Handlers of runtime errors must not return.

_____________________________________________________________________
|error	      procedure	called	  description			    |
|code_________by_runtime_system_____________________________________|
|case	      CaseError		  attempt to find case failed	    |
|return	      NoReturn		  function does	not return any value|
|range	      RangeError	  array	index out of bounds	    |
|typeguard    TypeGuardFailure	  type guard failure		    |
|conversion   ConversionError	  SHORT(val) failed		    |
|crend	      CoroutineReturn	  coroutine terminates with RETURN  |
|assertion    FailedAssertion	  ASSERT(assertion) failed	    |
|___________________________________________________________________|

SEE ALSO

Events
Edited by: borchert, last change: 1996/09/16, revision: 1.6, converted to HTML: 1997/04/28

Oberon || Library || Module Index || Search Engine || Definition || Module