Closed kamranayub closed 9 years ago
@kamranayub Agreed, this is an important feature. It is really frustrating to debug when the mainloop keeps firing.
@kamranayub Should we also add an option to toast a friendly message to the user if the game crashes hard? Like "Oops, something went wrong. Please contact your friendly neighborhood game developer"?
@eonarheim if such a message exists it should be configurable.
@alanag13 Agreed
I think it should just be an action that you can override.
engine.onFatalException = (ex) => { ex.Logger.getInstance().fatal(ex); };
try {
...
} catch (ex) {
this.onFatalException(ex);
}
@alanag13 @kamranayub I like having a event handler for this.
Should we expose something like this too?
engine.on('fatalexception', ()=>{...})
Thought of that, figured one of the fatal errors could be with the event dispatcher. This way it's very minimal, with no infrastructure to handle fatal exceptions.
On Thu, Apr 2, 2015 at 7:57 PM Erik Onarheim notifications@github.com wrote:
@alanag13 https://github.com/alanag13 @kamranayub https://github.com/kamranayub I like having a event handler for this.
Should we expose something like this too?
engine.on('fatalexception', ()=>{...})
— Reply to this email directly or view it on GitHub https://github.com/excaliburjs/Excalibur/issues/381#issuecomment-88991818 .
That is a good point... let's just do the engine.onFatalException
Exascerbated by mobile, update loop errors can cause crashing and are hard to debug. Can we figure out a way to intelligently catch errors in update loop and break/stop the game execution so it doesn't wedge browsers?