added run time error reporting

This commit is contained in:
Pavol Marko 2004-06-10 13:19:41 +00:00
parent d3bb65eec7
commit 259a9d70ec

View File

@ -105,7 +105,11 @@ cell CForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
} }
// exec // exec
cell retVal; cell retVal;
amx_Execv((*iter).pPlugin->getAMX(), &retVal, (*iter).func, m_NumParams, realParams); int err = amx_Execv((*iter).pPlugin->getAMX(), &retVal, (*iter).func, m_NumParams, realParams);
// log runtime error, if any
if (err != AMX_ERR_NONE)
AMXXLOG_Log("[AMXX] Run time error %d on line %ld (plugin \"%s\")", err, (*iter).pPlugin->getAMX()->curline, (*iter).pPlugin->getName());
// cleanup strings & arrays // cleanup strings & arrays
for (i = 0; i < m_NumParams; ++i) for (i = 0; i < m_NumParams; ++i)
{ {