file: 01-C-event.t package: muf status: alpha
This function is the standard way for the MUF application programmer to signal detection of an uncontinuable error.
The argument should be a valid event block,
containing at minimum a event, and normally
also a :formatString describing the
problem:
[ :event .err.simpleError
:formatString "The snarkle got frobulated."
| ]error
The ]error function ]signals
the event, then if ]signal returns
(indicating no handler resolved the problem)
either invokes the debugger or else prints
an error message and aborts, depending whether
@$s.breakEnable is nil.
The ]error function is currently implemented as:
: ]error { [] -> @ ! }
( Signal the given event: )
|dup[ ]signal
( Handlers didn't resolve event: )
@$s.breakEnable if
]invokeDebugger
else
@$s.errorOutput ]reportEvent
nil abort
fi
;
A convenience function error is also provided
for cases when specifying a string is sufficient: It
is currently implemented as
: error { $ -> @ } -> formatString
[ :event .err.simpleError
:formatString formatString
| ]error
;
Go to the first, previous, next, last section, table of contents.