mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Added Runtime.AddErrorHandler
This commit is contained in:
parent
9e80281d1a
commit
657a64f59c
8 changed files with 192 additions and 6 deletions
|
@ -214,6 +214,9 @@ static void TestReadCmd(Beefy::String& str);
|
|||
|
||||
static void Internal_FatalError(const char* error)
|
||||
{
|
||||
if (gBfRtCallbacks.CheckErrorHandler != NULL)
|
||||
gBfRtCallbacks.CheckErrorHandler("FatalError", error, NULL, 0);
|
||||
|
||||
if ((gClientPipe != NULL) && (!gTestBreakOnFailure))
|
||||
{
|
||||
Beefy::String str = ":TestFatal\t";
|
||||
|
@ -532,6 +535,12 @@ void* Internal::LoadSharedLibrary(char* libName)
|
|||
void* libHandle = BfpDynLib_Load(libName);
|
||||
if (libHandle == NULL)
|
||||
{
|
||||
if (gBfRtCallbacks.CheckErrorHandler != NULL)
|
||||
{
|
||||
if (gBfRtCallbacks.CheckErrorHandler("LoadSharedLibrary", libName, NULL, 0) == 1)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Beefy::String errorStr = StrFormat("Failed to load shared library: %s", libName);
|
||||
SETUP_ERROR(errorStr.c_str(), 1);
|
||||
BF_DEBUG_BREAK();
|
||||
|
@ -558,6 +567,12 @@ void* Internal::GetSharedProcAddress(void* libHandle, char* procName)
|
|||
int libFileNameLen = 4096;
|
||||
BfpDynLib_GetFilePath((BfpDynLib*)libHandle, libFileName, &libFileNameLen, NULL);
|
||||
|
||||
if (gBfRtCallbacks.CheckErrorHandler != NULL)
|
||||
{
|
||||
if (gBfRtCallbacks.CheckErrorHandler("GetSharedProcAddress", libFileName, procName, 0) == 1)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Beefy::String errorStr = StrFormat("Failed to load shared procedure '%s' from '%s'", procName, libFileName);
|
||||
SETUP_ERROR(errorStr.c_str(), 1);
|
||||
BF_DEBUG_BREAK();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue