diff options
author | 2021-04-25 03:22:01 +0200 | |
---|---|---|
committer | 2021-04-25 03:22:01 +0200 | |
commit | 2db86e2e9c8520e273aa8e7ddee3965198e266f5 (patch) | |
tree | 48aa489e0e40639af8357af3f60565d18e051a58 /src/frontend/mame/luaengine.cpp | |
parent | db9e4f94498acf0c69fbc651075a0e18d457bf0c (diff) |
Add a couple error messages to emu.thread.
Also changes exit(0) when the script of the thread returns non-string
to an error message instead. exit stops the whole process not just the
thread.
Diffstat (limited to 'src/frontend/mame/luaengine.cpp')
-rw-r--r-- | src/frontend/mame/luaengine.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index c7800f70829..ea0ad8fc3b9 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -959,8 +959,16 @@ void lua_engine::initialize() if (tmp != nullptr) ctx.result = tmp; else - exit(0); + osd_printf_error("[LUA ERROR] in thread: return value must be string\n"); } + else { + sol::error err = ret; + osd_printf_error("[LUA ERROR] in thread: %s\n", err.what()); + } + } + else { + sol::error err = res; + osd_printf_error("[LUA ERROR] when loading script for thread: %s\n", err.what()); } ctx.busy = false; }); |