Better exception handling

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Better exception handling

Post by zorg »

sherlockholmes221b wrote: Thu Apr 09, 2020 9:44 am Hiding bugs is not always bad. If the game is in its final version, it's better to show "Sorry, the game crashed. Please inform the developer", than "main.lua-38: Attempt to perform arithmetics on global 'variable' (nil value)'".In my opinion, the best way for handling bugs is to have global. unique _DEBUG variable, which, if set to true, shows whole error messages. Otherwise it should show only "Sorry for crash" message. Then you should just attach logging things to .txt or .log file (I recommend. It's very helpful for debugging since you don't need to error everything) and voila! The only thing you should be aware of is the error in this code. If you do something bad, you can have some trouble with debugging later.
The post you quoted did agree with you by the way; it's just that whether the error message is useful to the end-user or the developer wasn't really what the (3 years old) thread was about, and the relevant answers were already given previously, so that the OP could take appropriate steps, as they said in their edited first post. :awesome:
stop. necroing. threads. :V
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: No registered users and 59 guests