How to catch errors from pub.lua?

BlitzMax Forums/BlitzMax Programming/How to catch errors from pub.lua?

Pineapple(Posted 2012) [#1]
When something goes funny in a script, sometimes something like this gets spit out to the console:

PANIC: unprotected error in call to Lua API (titan/scripts/player.lua:131: attempt to call global 'test' (a nil value))


Problem is, that's not very useful when the person scripting isn't running the program with a console. How can I intercept that error and output it differently?


edit: I should probably have looked more into the documentation first, I found it. (using lua_atpanic)

Last edited 2012