Fixing Bugs After Release
Posted: Tue Aug 19, 2014 1:01 am
I've been working on a game for the past year that I plan to release on iOS/Android. Up until this point I've neglected to do any sort of meaningful error handling. Typically, I'll simply have my functions return false on error and basically close down the app. I know if I don't take steps now to integrate some sort of meaningful error handling I'll be in a world of trouble if the app starts crashing on other people's devices during testing or after release.
My question is, what sort of mechanism does everyone recommend for handling this issue?
I've seen one idea so far that seems alright. It works like this:
1. You have an Error class that would store an error message string and possibly any other useful data for fixing bugs, maybe subclass it for specific errors.
2. You keep a globally accessible stack of errors
3. Right before you do an operation that could potentially go wrong, you create an error instance and push it onto the error stack
4. Pop the error off the stack if things go smoothly
5. If an error occurs, print out the entire stack and you have a half-assed stack trace
I'm interested in hearing about your guys' approaches/opinions though before I decide on a solution.
My question is, what sort of mechanism does everyone recommend for handling this issue?
I've seen one idea so far that seems alright. It works like this:
1. You have an Error class that would store an error message string and possibly any other useful data for fixing bugs, maybe subclass it for specific errors.
2. You keep a globally accessible stack of errors
3. Right before you do an operation that could potentially go wrong, you create an error instance and push it onto the error stack
4. Pop the error off the stack if things go smoothly
5. If an error occurs, print out the entire stack and you have a half-assed stack trace
I'm interested in hearing about your guys' approaches/opinions though before I decide on a solution.