I am trying to integrate a Lua Scripting interface into my C# project by using LuaInterface.
It works as expected if I execute syntactically correct code, but as soon as a syntax error (or any other error as it seems) is introduced to the script an SEHException gets thrown without any information regarding the error.
A simple example to trigger the behavior: new LuaInterface.Lua().DoString("die");
That of course completely nullifies Lua’s error handling mechanisms and is a show-stopper for me.
Apparently this is a known bug which is open since 2011.
Are there any workarounds, a version of LuaInterface without this bug or is there an alternative lua wrapper which correctly handles errors?
Lua errors (syntax or runtime errors) encountered by
DoStringshould result in aLuaExceptionbeing thrown. Its message will contain the error string generated by Lua. For instance, given your example:You should get the following error:
You don’t show any context for your one liner. Is it wrapped in a try-catch block?
If so, perhaps it’s a bug?