Continuing the discussion from Collision that would reset the world?:
Our friend @betkowski has been having some serious trouble with getting his Debugger to play nicely, which results in his whole SWF crashing when an error gets thrown. I don’t think I have to tell anyone how frustrating that must be. While trying to help him out, @Ultima2876 suggested an alternate way of displaying error traces in situations where a debugger isn’t available, and that got me to thinking…
Flashpunk has a debugging console already. What if it was possible to automatically catch any errors, print them to the debug console, and pause the game without allowing it to crash? It would be immensely helpful in scenarios when you can’t access a native debugger; I’m thinking mobile development specifically.
Flash doesn’t have global error handling built in, but since Flashpunk runs everything from one top-level engine function, it would be trivial to set up a try...catch
block that snags every error the game could throw from within the update() hierarchy. Naturally it would be optional, since exception handling comes with a certain amount of overhead, but it would be great to have available.
Does anyone have any thoughts on the matter?