From 259a9d70ecb57cc091c949d84d741798d74e57b0 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Thu, 10 Jun 2004 13:19:41 +0000 Subject: [PATCH] added run time error reporting --- amxmodx/CForward.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/amxmodx/CForward.cpp b/amxmodx/CForward.cpp index b3f12fcd..feea95fe 100755 --- a/amxmodx/CForward.cpp +++ b/amxmodx/CForward.cpp @@ -105,7 +105,11 @@ cell CForward::execute(cell *params, ForwardPreparedArray *preparedArrays) } // exec 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 for (i = 0; i < m_NumParams; ++i) {