diff --git a/examples/functions/index.js b/examples/functions/index.js index fae5e8f..31d3eed 100644 --- a/examples/functions/index.js +++ b/examples/functions/index.js @@ -9,5 +9,9 @@ lua.registerFunction('add', function(a, b){ lua.doStringSync("print('Result in Lua: ' .. add(10, 5))"); var lua_two = new nodelua.LuaState('two'); -// this will throw an error -lua_two.doStringSync("add(10, 5)"); \ No newline at end of file +try{ + lua_two.doStringSync("add(10, 5)"); +} catch(e){ + console.log("Error: "); + console.log(e); +}