Improve error message for main.lua syntax errors;

This commit is contained in:
bjorn 2017-06-10 17:43:54 -07:00
parent 8c0e4bd416
commit 074e55dc8b
1 changed files with 2 additions and 1 deletions

View File

@ -109,7 +109,8 @@ void lovrInit(lua_State* L, int argc, char** argv) {
// Preload libraries
luax_preloadmodule(L, "json", luaopen_cjson);
if (luaL_loadbuffer(L, (const char*) boot_lua, boot_lua_len, "boot.lua") || lua_pcall(L, 0, 0, 0)) {
lua_pushcfunction(L, getStackTrace);
if (luaL_loadbuffer(L, (const char*) boot_lua, boot_lua_len, "boot.lua") || lua_pcall(L, 0, 0, -2)) {
handleError(L, lua_tostring(L, -1));
}
}