Added better debug

Now triggers a breakpoint when a function fails
This commit is contained in:
Pasha Bibko
2025-07-20 14:18:31 +01:00
parent 8f75e52a07
commit ac656b7b0f
5 changed files with 36 additions and 52 deletions

View File

@@ -1,5 +1,7 @@
#pragma once
#include <OS.h>
#include <type_traits>
#include <cstdlib>
@@ -11,6 +13,14 @@ namespace LXC::Util
explicit FunctionFail(ErrorType _err)
: error(_err)
{
// Only checks for a debugger when compiled in Debug mode //
#ifdef _DEBUG
// Triggers a breakpoint when a debugger is attached as a function has failed //
if (IsDebuggerPresent())
DebugBreak();
#endif
}
ErrorType error;