aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api/s_async.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-08-05 00:49:35 -0400
committerkwolekr <kwolekr@minetest.net>2015-08-05 21:13:03 -0400
commitbcf47bc67cf3e1c2f410a81e26ceab1bdab06b4a (patch)
tree11bd99b70ceb33175d7883cea4ab287cc5b09175 /src/script/cpp_api/s_async.cpp
parent3183d5a4038f16b5b4cbcfd0dac5f8d458bf8ba2 (diff)
downloadminetest-bcf47bc67cf3e1c2f410a81e26ceab1bdab06b4a.tar.xz
Improve Script CPP API diagnostics
Diffstat (limited to 'src/script/cpp_api/s_async.cpp')
-rw-r--r--src/script/cpp_api/s_async.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/script/cpp_api/s_async.cpp b/src/script/cpp_api/s_async.cpp
index eb1a2923a..0e2a006ca 100644
--- a/src/script/cpp_api/s_async.cpp
+++ b/src/script/cpp_api/s_async.cpp
@@ -164,9 +164,7 @@ void AsyncEngine::step(lua_State *L, int errorhandler)
lua_pushlstring(L, jobDone.serializedResult.data(),
jobDone.serializedResult.size());
- if (lua_pcall(L, 2, 0, errorhandler)) {
- script_error(L);
- }
+ PCALL_RESL(L, lua_pcall(L, 2, 0, errorhandler));
}
resultQueueMutex.Unlock();
lua_pop(L, 1); // Pop core
@@ -293,8 +291,9 @@ void* AsyncWorkerThread::Thread()
toProcess.serializedParams.data(),
toProcess.serializedParams.size());
- if (lua_pcall(L, 2, 1, m_errorhandler)) {
- scriptError();
+ int result = lua_pcall(L, 2, 1, m_errorhandler);
+ if (result) {
+ PCALL_RES(result);
toProcess.serializedResult = "";
} else {
// Fetch result