I know the basic difference between lua_call() or lua_pcall(), the later one provides more error details.
Is there any other difference? How to decide which to use?
Use lua_pcall when you need to handle potential errors at that point in the code. Otherwise, use lua_call and let the error move up the call chain. No need to get paranoid using lua_pcall everywhere.
lua_call is faster than lua_pcall.
Just make sure there is at least one lua_pcall at the top or your app will panic and exit when finding any Lua errors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With