Fixing Bugs After Release

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Fixing Bugs After Release

Postby X Abstract X on Tue Aug 19, 2014 2: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.
X Abstract X
Chaos Rift Regular
Chaos Rift Regular
 
Posts: 178
Joined: Thu Feb 11, 2010 11:46 pm
Location: Ottawa, Canada

Re: Fixing Bugs After Release

Postby dandymcgee on Tue Aug 19, 2014 10:05 am

Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: Fixing Bugs After Release

Postby X Abstract X on Tue Aug 19, 2014 2:16 pm



Actually, I'm working in 99% pure C++ so I was hoping for a cross-platform method. I'll have a look at the link though for inspiration. Thanks.
X Abstract X
Chaos Rift Regular
Chaos Rift Regular
 
Posts: 178
Joined: Thu Feb 11, 2010 11:46 pm
Location: Ottawa, Canada

Re: Fixing Bugs After Release

Postby dandymcgee on Tue Aug 19, 2014 2:27 pm

X Abstract X wrote:


Actually, I'm working in 99% pure C++ so I was hoping for a cross-platform method. I'll have a look at the link though for inspiration. Thanks.

Oh, read "iOS" and made an assumption without fully understanding your scope, sorry about that. The NSError implementation could serve as a useful example I suppose.

Anyway, the custom class you described sounds exactly like how Exceptions work in C#. The major difference is that your resources aren't managed in C++. You need to be careful about how you throw errors to be sure you're not skipping over code which releases unmanaged resources.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire


Return to Programming Discussion

Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron