From 46458cdbfe9e5429fbd33602e7acbf19a58da517 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 4 Jun 2026 17:56:01 -0700 Subject: [PATCH] Revert Call_Finish() to correctly return an error code. Bug: issue #2474 --- core/logic/smn_functions.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/logic/smn_functions.cpp b/core/logic/smn_functions.cpp index f74db93b..39312b32 100644 --- a/core/logic/smn_functions.cpp +++ b/core/logic/smn_functions.cpp @@ -563,8 +563,9 @@ static cell_t sm_CallFinish(IPluginContext *pContext, const cell_t *params) { IPluginFunction *pFunction = s_pFunction; ResetCall(); + DetectExceptions eh(pContext); if (!pFunction->Invoke(local_args, result)) - return 0; + return eh.Code(); } else { IForward *pForward = s_pForward; ResetCall(); @@ -572,7 +573,7 @@ static cell_t sm_CallFinish(IPluginContext *pContext, const cell_t *params) return pContext->ThrowNativeErrorEx(err, nullptr); } - return 1; + return SP_ERROR_NONE; } static cell_t sm_CallCancel(IPluginContext *pContext, const cell_t *params)