Oberon || Library || Module Index || Search Engine || Definition || Module
VAR handlerSet: Errors.HandlerSet; VAR errors: INTEGER; (* number of errors *) VAR fatalcode: INTEGER; (* exit code on fatal events *)
PROCEDURE CatchEvent(type: Events.EventType; kind: Errors.Kind); PROCEDURE Conclude(object: RelatedEvents.Object; kind: Errors.Kind; text: ARRAY OF CHAR); PROCEDURE ConcludeS(s: Streams.Stream; object: RelatedEvents.Object; kind: Errors.Kind; text: ARRAY OF CHAR);
Beside message printing following actions are being taken in dependence of the event classification:
CatchEvent installs the appropiate error handler of Conclusions for type in dependence of kind. This is equivalent to Errors.CatchEvent(handlerSet, kind, type).
ConcludeS prints the queue of events which are related to object to s in LIFO-order. ConcludeS adds the basename of the command (see UnixArguments), the classification (except for message) and text (if non-empty) to the first message. Further messages are printed in subsequent lines. "*no messages found*" is printed for empty queues. Conclude calls ConcludeS with s = Streams.stderr.
VAR errors: RelatedEvents.Object; s: Streams.Stream; (* ... *) NEW(errors); RelatedEvents.QueueEvents(errors); IF ~UnixFiles.Open(s, filename, "r", Streams.onebuf, errors) THEN (* print message and terminate *) Conclusions.Conclude(errors, Errors.fatal, filename); END;
Oberon || Library || Module Index || Search Engine || Definition || Module