diff --git a/lib/error.g b/lib/error.g index ff636977d1..590249e90e 100644 --- a/lib/error.g +++ b/lib/error.g @@ -56,17 +56,17 @@ BIND_GLOBAL("WHERE", function( context, depth, outercontext) bottom := GetBottomLVars(); lastcontext := outercontext; while depth > 0 and context <> bottom do - PRINT_CURRENT_STATEMENT("*errout*", context); - PrintTo("*errout*", " called from\n"); + PRINT_CURRENT_STATEMENT(ErrorOutput, context); + PrintTo(ErrorOutput, " called from\n"); lastcontext := context; context := ParentLVars(context); depth := depth-1; od; if depth = 0 then - PrintTo("*errout*", "... "); + PrintTo(ErrorOutput, "... "); else f := ContentsLVars(lastcontext).func; - PrintTo("*errout*", "( )\n called from read-eval loop "); fi; end); @@ -81,11 +81,11 @@ BIND_GLOBAL("Where", function(arg) fi; if ErrorLVars = fail or ErrorLVars = GetBottomLVars() then - PrintTo("*errout*", "not in any function "); + PrintTo(ErrorOutput, "not in any function "); else WHERE(ParentLVars(ErrorLVars),depth, ErrorLVars); fi; - PrintTo("*errout*", "at ",INPUT_FILENAME(),":",INPUT_LINENUMBER(),"\n"); + PrintTo(ErrorOutput, "at ",INPUT_FILENAME(),":",INPUT_LINENUMBER(),"\n"); end); OnBreak := Where; @@ -122,7 +122,7 @@ BIND_GLOBAL("ErrorInner", context := arg[1].context; if not IsLVarsBag(context) then - PrintTo("*errout*", "ErrorInner: option context must be a local variables bag\n"); + PrintTo(ErrorOutput, "ErrorInner: option context must be a local variables bag\n"); LEAVE_ALL_NAMESPACES(); JUMP_TO_CATCH(1); fi; @@ -130,7 +130,7 @@ BIND_GLOBAL("ErrorInner", if IsBound(arg[1].justQuit) then justQuit := arg[1].justQuit; if not justQuit in [false, true] then - PrintTo("*errout*", "ErrorInner: option justQuit must be true or false\n"); + PrintTo(ErrorOutput, "ErrorInner: option justQuit must be true or false\n"); LEAVE_ALL_NAMESPACES(); JUMP_TO_CATCH(1); fi; @@ -141,7 +141,7 @@ BIND_GLOBAL("ErrorInner", if IsBound(arg[1].mayReturnVoid) then mayReturnVoid := arg[1].mayReturnVoid; if not mayReturnVoid in [false, true] then - PrintTo("*errout*", "ErrorInner: option mayReturnVoid must be true or false\n"); + PrintTo(ErrorOutput, "ErrorInner: option mayReturnVoid must be true or false\n"); LEAVE_ALL_NAMESPACES(); JUMP_TO_CATCH(1); fi; @@ -152,7 +152,7 @@ BIND_GLOBAL("ErrorInner", if IsBound(arg[1].mayReturnObj) then mayReturnObj := arg[1].mayReturnObj; if not mayReturnObj in [false, true] then - PrintTo("*errout*", "ErrorInner: option mayReturnObj must be true or false\n"); + PrintTo(ErrorOutput, "ErrorInner: option mayReturnObj must be true or false\n"); LEAVE_ALL_NAMESPACES(); JUMP_TO_CATCH(1); fi; @@ -163,7 +163,7 @@ BIND_GLOBAL("ErrorInner", if IsBound(arg[1].printThisStatement) then printThisStatement := arg[1].printThisStatement; if not printThisStatement in [false, true] then - PrintTo("*errout*", "ErrorInner: option printThisStatement must be true or false\n"); + PrintTo(ErrorOutput, "ErrorInner: option printThisStatement must be true or false\n"); LEAVE_ALL_NAMESPACES(); JUMP_TO_CATCH(1); fi; @@ -174,7 +174,7 @@ BIND_GLOBAL("ErrorInner", if IsBound(arg[1].lateMessage) then lateMessage := arg[1].lateMessage; if not lateMessage in [false, true] and not IsString(lateMessage) then - PrintTo("*errout*", "ErrorInner: option lateMessage must be a string or false\n"); + PrintTo(ErrorOutput, "ErrorInner: option lateMessage must be a string or false\n"); LEAVE_ALL_NAMESPACES(); JUMP_TO_CATCH(1); fi; @@ -184,7 +184,7 @@ BIND_GLOBAL("ErrorInner", earlyMessage := arg[2]; if Length(arg) <> 2 then - PrintTo("*errout*", "ErrorInner: new format takes exactly two arguments\n"); + PrintTo(ErrorOutput, "ErrorInner: new format takes exactly two arguments\n"); LEAVE_ALL_NAMESPACES(); JUMP_TO_CATCH(1); fi; @@ -213,7 +213,7 @@ BIND_GLOBAL("ErrorInner", fi; PrintTo(stream, " called from"); fi; - PrintTo("*errout*", "\n"); + PrintTo(ErrorOutput, "\n"); end; ErrorLevel := ErrorLevel+1; @@ -231,14 +231,14 @@ BIND_GLOBAL("ErrorInner", # It is used by HPC-GAP to e.g. suppress error messages in worker # threads. if not SilentNonInteractiveErrors then - printEarlyMessage("*errout*"); + printEarlyMessage(ErrorOutput); if AlwaysPrintTracebackOnError then - printEarlyTraceback("*errout*"); + printEarlyTraceback(ErrorOutput); if IsBound(OnBreak) and IsFunction(OnBreak) then OnBreak(); fi; else - PrintTo("*errout*", "\n"); + PrintTo(ErrorOutput, "\n"); fi; fi; if IsHPCGAP then @@ -268,8 +268,8 @@ BIND_GLOBAL("ErrorInner", JUMP_TO_CATCH(0); fi; - printEarlyMessage("*errout*"); - printEarlyTraceback("*errout*"); + printEarlyMessage(ErrorOutput); + printEarlyTraceback(ErrorOutput); if SHOULD_QUIT_ON_BREAK() then # Again, the default is to not print the rest of the traceback. @@ -288,7 +288,7 @@ BIND_GLOBAL("ErrorInner", # Now print lateMessage and OnBreakMessage a la "press return; to .." if IsString(lateMessage) then - PrintTo("*errout*", lateMessage,"\n"); + PrintTo(ErrorOutput, lateMessage,"\n"); elif lateMessage then if IsBound(OnBreakMessage) and IsFunction(OnBreakMessage) then OnBreakMessage();