feat: add some low level error handling

This commit is contained in:
k0t9i
2023-10-19 10:04:52 +04:00
parent 641e20e82a
commit 2e025fd0cf
9 changed files with 203 additions and 74 deletions

View File

@@ -1,17 +1,25 @@
#include "pch.h"
#include "FName.h"
#include "Domain/Exceptions.h"
using namespace L2Bot::Domain;
namespace Interlude
{
FNameEntry* (__cdecl* FName::__GetEntry)(int) = 0;
//todo exception(?)
FNameEntry* FName::GetEntry(int index) const
{
if (__GetEntry) {
return(*__GetEntry)(index);
__try {
if (__GetEntry) {
return(*__GetEntry)(index);
}
return 0;
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
throw CriticalRuntimeException(L"FName::GetEntry failed");
}
return 0;
}
void FName::Init(HMODULE hModule)