Custom Event error handler
Tapple Gao
Luau scripts have a lot more ways to crash than LSL scripts. I wrote this as a proof of concept on making LLTimers and LLEvents crash proof:
It might be nice if there was a function like
LLEvents:setDefaultErrorHandler(errorHandler)
that did the same thing the above code does, without needing to wrap/monkey patch anything.Log In
Tapple Gao
I haven't structured my slua scripts around linkset data and lljson yet, but I plan to. I'm not sure how much code I want to spend verifying that my linkset data has a sane format vs just leaving it to some high-level code similar to the above that deletes the linkset data key if there ends up being a problem using it.
I'll probably write some sort of linkset data wrapper that works similar to python's with block. That would be a lot more specific than "what to do for general unhandled errors". This wrapper would probably solve most random crashes I can currently imagine, while I'm this early in my slua journey.