1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
#############################################################################
##
#W errors.g The SCSCP package Olexandr Konovalov
#W Steve Linton
##
#############################################################################
MakeReadWriteGlobal( "ErrorInner" );
UnbindGlobal( "ErrorInner" );
BindGlobal( "ErrorInner", function( arg )
if not IsLVarsBag(arg[1].context) then
PrintTo("*errout*", "ErrorInner: option context must be a local variables bag\n");
LEAVE_ALL_NAMESPACES();
JUMP_TO_CATCH(1);
fi;
if IsBound(arg[1].justQuit) then
if not arg[1].justQuit in [false, true] then
PrintTo("*errout*", "ErrorInner: option justQuit must be true or false\n");
LEAVE_ALL_NAMESPACES();
JUMP_TO_CATCH(1);
fi;
fi;
if IsBound(arg[1].mayReturnVoid) then
if not arg[1].mayReturnVoid in [false, true] then
PrintTo("*errout*", "ErrorInner: option mayReturnVoid must be true or false\n");
LEAVE_ALL_NAMESPACES();
JUMP_TO_CATCH(1);
fi;
fi;
if IsBound(arg[1].mayReturnObj) then
if not arg[1].mayReturnObj in [false, true] then
PrintTo("*errout*", "ErrorInner: option mayReturnObj must be true or false\n");
LEAVE_ALL_NAMESPACES();
JUMP_TO_CATCH(1);
fi;
fi;
if IsBound(arg[1].printThisStatement) then
if not arg[1].printThisStatement in [false, true] then
PrintTo("*errout*", "ErrorInner: option printThisStatement must be true or false\n");
LEAVE_ALL_NAMESPACES();
JUMP_TO_CATCH(1);
fi;
fi;
if IsBound(arg[1].lateMessage) then
if not arg[1].lateMessage in [false, true] and not IsString(arg[1].lateMessage) then
PrintTo("*errout*", "ErrorInner: option lateMessage must be a string or false\n");
LEAVE_ALL_NAMESPACES();
JUMP_TO_CATCH(1);
fi;
fi;
if Length(arg) <> 2 then
PrintTo("*errout*","ErrorInner: new format takes exactly two arguments\n");
LEAVE_ALL_NAMESPACES();
JUMP_TO_CATCH(1);
fi;
JUMP_TO_CATCH( arg[2] ); # arg[2] = earlyMessage in the library version of ErrorInner
end );
###########################################################################
##
#E
##
|