1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Improved fatal errors - they run through crash handler now

This commit is contained in:
Brian Fiete 2020-05-13 12:30:25 -07:00
parent 9010d8ed47
commit 767ced3563
5 changed files with 48 additions and 30 deletions

View file

@ -414,15 +414,9 @@ void Beefy::BFFatalError(const StringImpl& message, const StringImpl& file, int
if (gBFApp != NULL)
gBFApp->mSysDialogCnt++;
#endif
#ifdef _DEBUG
OutputDebugStrF("FATAL ERROR: %s\n", message.c_str());
_wassert(UTF8Decode(message).c_str(), UTF8Decode(file).c_str(), line);
#else
String error = StrFormat("%s in %s:%d", message.c_str(), file.c_str(), line);
::MessageBoxA(NULL, error.c_str(), "FATAL ERROR", MB_ICONERROR | MB_OK);
exit(1);
#endif
String failMsg = StrFormat("%s in %s:%d", message.c_str(), file.c_str(), line);
BfpSystem_FatalError(failMsg.c_str(), "FATAL ERROR");
#ifndef BF_NO_BFAPP
if (gBFApp != NULL)