{{
ENABLE {
AMEvents.Debugged, AMEvents.Debugging => REJECT;
ABORTED => REJECT;
UNWIND => REJECT;
FS.Error => {
IF suspensionCount >0 THEN REJECT;
msg1 ← "FS.Error";
msg2 ← error.explanation;
MaybeLeaveKansas[];
GO TO oops};
VM.AddressFault => {
IF suspensionCount >0 THEN REJECT;
msg1 ← IO.PutFR["AddressFault: %b", IO.card[LOOPHOLE[address, LONG CARDINAL]]];
MaybeLeaveKansas[];
GO TO oops};
AMTypes.Error => {
IF suspensionCount >0 THEN REJECT;
msg1 ←
SELECT reason
FROM
noSymbols => "NoSymbols",
notImplemented => "NotImplemented",
incompatibleTypes => "IncompatibleTypes",
rangeFault => "RangeFault",
notMutable => "NotMutable",
internalTV => "InternalTV",
badName => "BadName",
badIndex => "BadIndex",
typeFault => "TypeFault",
ENDCASE => "Unknown AMTypes.Error";
msg2 ← msg;
MaybeLeaveKansas[];
GO TO oops};
SafeStorage.InvalidType => {
IF suspensionCount >0 THEN REJECT;
msg1 ← "InvalidType";
MaybeLeaveKansas[];
GO TO oops};
SafeStorage.NarrowRefFault => {
IF suspensionCount >0 THEN REJECT;
msg1 ← "NarrowRefFault";
MaybeLeaveKansas[];
GO TO oops};
RuntimeError.BoundsFault => {
IF suspensionCount >0 THEN REJECT;
msg1 ← "BoundsFault";
MaybeLeaveKansas[];
GO TO oops};
RuntimeError.ControlFault => {
IF suspensionCount >0 THEN REJECT;
msg1 ← "ControlFault";
MaybeLeaveKansas[];
GO TO oops};
RuntimeError.DivideCheck => {
IF suspensionCount >0 THEN REJECT;
msg1 ← "DivideCheck";
MaybeLeaveKansas[];
GO TO oops};
RuntimeError.PointerFault => {
IF suspensionCount >0 THEN REJECT;
msg1 ← "PointerFault";
MaybeLeaveKansas[];
GO TO oops};
RuntimeError.StartFault => {
IF suspensionCount >0 THEN REJECT;
msg1 ← "StartFault";
MaybeLeaveKansas[];
GO TO oops};
RuntimeError.StackError => {
IF suspensionCount >0 THEN REJECT;
msg1 ← "StackError";
MaybeLeaveKansas[];
GO TO oops};
RuntimeError.UnboundProcedure => {
IF suspensionCount >0 THEN REJECT;
msg1 ← "UnboundProcedure";
MaybeLeaveKansas[];
GO TO oops};
RuntimeError.ZeroDivisor => {
IF suspensionCount >0 THEN REJECT;
msg1 ← "ZeroDivisor";
MaybeLeaveKansas[];
GO TO oops};
VM.CantAllocate => {
IF suspensionCount >0 THEN REJECT;
msg1 ← "VM.CantAllocate";
MaybeLeaveKansas[];
GO TO oops};
VM.WriteProtectFault => {
IF suspensionCount >0 THEN REJECT;
msg1 ← IO.PutFR["WriteProtectFault: %b", IO.card[LOOPHOLE[address, LONG CARDINAL]]];
MaybeLeaveKansas[];
GO TO oops};
WorldVM.AddressFault => {
IF suspensionCount >0 THEN REJECT;
msg1 ← IO.PutFR["WriteProtectFault: %b", IO.card[LOOPHOLE[addr, LONG CARDINAL]]];
MaybeLeaveKansas[];
GO TO oops};
WorldVM.BadWorld => {
IF suspensionCount >0 THEN REJECT;
msg1 ← "WorldVM.BadWorld";
MaybeLeaveKansas[];
GO TO oops};
SuspendBackStop => {suspensionCount ← suspensionCount + 1; RESUME};
ResumeBackStop => {suspensionCount ← suspensionCount - 1; RESUME};
ANY =>
TRUSTED{
anyMsg: CARDINAL;
anySignal: UNSPECIFIED;
IF suspensionCount >0 THEN REJECT;
IF alwaysRejectAny THEN REJECT;
[anyMsg, anySignal] ← SIGNAL RuntimeError.SendMsgSignal;
lastAnyMsg ← anyMsg;
lastAnySignal ← anySignal;
SELECT
LOOPHOLE[anySignal,
CARDINAL]
FROM
177777B => {
the overused unnamed ERROR
msg1 ← "unnamed ERROR";
};
ENDCASE => {
msg1 ← IO.PutFR[
"UnknownError[sig: %b, msg: %b]",
IO.card[LOOPHOLE[anySignal, CARDINAL]],
IO.card[anyMsg]
];
};
MaybeLeaveKansas[];
GO TO oops}};
inner[];
RETURN [NIL]}
EXITS
oops => {
IF msg2 # NIL THEN msg1 ← msg1.Cat["[", msg2, "]"];
lagLagMsg ← lagMsg;
RETURN[(lagMsg ← msg1)]}}