Stable object exceptions
MODULE; IMPORT RdUtils, Stdio, Wr, Thread, Process; PROCEDURE StableError ToText (code: Code): TEXT =
RdUtils.FailureText
does the same conversion for Rd/Wr Excpetions. We can use it here:
BEGIN RETURN RdUtils.FailureText(code); END ToText; PROCEDUREHalt (msg: TEXT) = <*FATAL Wr.Failure, Thread.Alerted*> BEGIN Wr.PutText(Stdio.stderr, "****\n"); Wr.PutText(Stdio.stderr, "**** fatal stable object error\n"); Wr.PutText(Stdio.stderr, "****\n"); Wr.PutText(Stdio.stderr, "**** " & msg & "\n"); Wr.PutText(Stdio.stderr, "****\n\n\nProgram aborted\n"); Process.Exit(1); END Halt; BEGIN END StableError.