- marked a few Printf calls in critical error paths as PRINT_NONOTIFY.

This commit is contained in:
Christoph Oelckers 2022-10-20 23:55:29 +02:00
parent 07f08de474
commit ef887403cf
5 changed files with 7 additions and 8 deletions

View file

@ -683,7 +683,7 @@ void FSerializer::ReadObjects(bool hubtravel)
{ {
r->mObjects.Clamp(size); // close all inner objects. r->mObjects.Clamp(size); // close all inner objects.
// In case something in here throws an error, let's continue and deal with it later. // In case something in here throws an error, let's continue and deal with it later.
Printf(TEXTCOLOR_RED "'%s'\n while restoring %s\n", err.GetMessage(), obj ? obj->GetClass()->TypeName.GetChars() : "invalid object"); Printf(PRINT_NONOTIFY, TEXTCOLOR_RED "'%s'\n while restoring %s\n", err.GetMessage(), obj ? obj->GetClass()->TypeName.GetChars() : "invalid object");
mErrors++; mErrors++;
} }
} }

View file

@ -925,7 +925,7 @@ void M_Init (void)
catch (CVMAbortException &err) catch (CVMAbortException &err)
{ {
err.MaybePrintMessage(); err.MaybePrintMessage();
Printf("%s", err.stacktrace.GetChars()); Printf(PRINT_NONOTIFY, "%s", err.stacktrace.GetChars());
I_FatalError("Failed to initialize menus"); I_FatalError("Failed to initialize menus");
} }
M_CreateMenus(); M_CreateMenus();

View file

@ -682,8 +682,7 @@ void CVMAbortException::MaybePrintMessage()
auto m = GetMessage(); auto m = GetMessage();
if (m != nullptr) if (m != nullptr)
{ {
Printf(TEXTCOLOR_RED); Printf(PRINT_NONOTIFY, TEXTCOLOR_RED "%s\n", m);
Printf("%s\n", m);
SetMessage(""); SetMessage("");
} }
} }

View file

@ -1231,14 +1231,14 @@ void D_DoomLoop ()
{ {
if (error.GetMessage ()) if (error.GetMessage ())
{ {
Printf (PRINT_BOLD, "\n%s\n", error.GetMessage()); Printf (PRINT_NONOTIFY | PRINT_BOLD, "\n%s\n", error.GetMessage());
} }
D_ErrorCleanup (); D_ErrorCleanup ();
} }
catch (CVMAbortException &error) catch (CVMAbortException &error)
{ {
error.MaybePrintMessage(); error.MaybePrintMessage();
Printf("%s", error.stacktrace.GetChars()); Printf(PRINT_NONOTIFY, "%s", error.stacktrace.GetChars());
D_ErrorCleanup(); D_ErrorCleanup();
} }
} }

View file

@ -538,7 +538,7 @@ bool FThinkerList::DoDestroyThinkers()
{ {
Printf("VM exception in DestroyThinkers:\n"); Printf("VM exception in DestroyThinkers:\n");
exception.MaybePrintMessage(); exception.MaybePrintMessage();
Printf("%s", exception.stacktrace.GetChars()); Printf(PRINT_NONOTIFY, "%s", exception.stacktrace.GetChars());
// forcibly delete this. Cleanup may be incomplete, though. // forcibly delete this. Cleanup may be incomplete, though.
node->ObjectFlags |= OF_YesReallyDelete; node->ObjectFlags |= OF_YesReallyDelete;
delete node; delete node;
@ -546,7 +546,7 @@ bool FThinkerList::DoDestroyThinkers()
} }
catch (CRecoverableError &exception) catch (CRecoverableError &exception)
{ {
Printf("Error in DestroyThinkers: %s\n", exception.GetMessage()); Printf(PRINT_NONOTIFY, "Error in DestroyThinkers: %s\n", exception.GetMessage());
// forcibly delete this. Cleanup may be incomplete, though. // forcibly delete this. Cleanup may be incomplete, though.
node->ObjectFlags |= OF_YesReallyDelete; node->ObjectFlags |= OF_YesReallyDelete;
delete node; delete node;