Coming from an Erlang world then the natural thing to do is to generate an error/exception and crash the process. The erlang process that is. This is safe to do in Erlang as it will not take down the system. In general I would say it is better to signal the error early instead of trying to be too nice and keep going which can lead to strange results which are hard to find the cause of.
Shameless plug: if you are interested in running Lua on top of Erlang there is Luerl
https://github.com/rvirding/luerl