Thread:User talk:CodeCat/"I don't understand this crusade against script errors..."/reply (5)

I searched for different ways to handle it in Lua. Apparently, a common practice in Lua is to return nil and an error message if something goes wrong that couldn't easily be prevented. The example they give here is trying to open a file that doesn't exist. That's not in the programmer's power to predict and prevent, so the function does not raise an error, but instead gives back nil, and an error message describing the problem. If we want to eliminate script errors, I think that's a good way to handle things, and it's something we can do gradually. It doesn't answer the question of how to notify the user, but at least it "prepares" our code for what we want to achieve.