gitdefence / game-off-2012

Build networks, destroy bugs
http://www.justinmcgirr.com/gitdefence/master/game/
5 stars 1 forks source link

Exceptionhandling #109

Open yeerkkiller1 opened 11 years ago

yeerkkiller1 commented 11 years ago

Added exception handling to basically all places which could throw (at a high level of course). Also have exception code to try to recover from most exceptions, albeit in a destructive manner.

crazy2be commented 11 years ago

This seems quite complex, and it actually makes me more worried that there will be crashes, and of a worse variety. The only place I could see error checking like this having a justified complexity is before calling into draw() and update() on game objects, where you might be able to either ignore the error (and just draw everything else), or remove the object from your tree, and continue without it. Correct me if I'm wrong, but these spots seem like the only places where you can have a reasonable recovery.

Also, the large majority of our code lives behind these update() and draw() calls, and thus has these spots have the most potential for crashes. In fact, every crash I've seen so far lives behind these calls (with the exception of the range circle being invalid in gitDifence.js, but that bug would be much better fixed through simpler means.)

yeerkkiller1 commented 11 years ago

This probably won't get merged in for a while. And when it does get merged in only part of it will be merged in.