Page 1 of 1

Any reason why love.errhand wouldn't work?

Posted: Wed Aug 30, 2017 10:45 pm
by dizzykiwi3
I'm currently attempting to write a custom love.errhand, however, whenever it is called, my game simply quits.

To initiate the crash I'm running

Code: Select all

a="b"+"c"
However, even when changing love.errhand to the default code found at https://love2d.org/wiki/love.errhand, it still simply closes the game, no error message. I'm able to see console print statements called from within the love.errhand, but I have no idea why this keeps happening.

Any help would be much appreciated!

p.s. running on a mac if this makes any difference.

Re: Any reason why love.errhand wouldn't work?

Posted: Wed Aug 30, 2017 10:52 pm
by grump
What are you doing in your errhand? Where do you provoke the error? Maybe there is no window yet, and you're trying do draw stuff? Move the error to love.draw or love.update.

Re: Any reason why love.errhand wouldn't work?

Posted: Wed Aug 30, 2017 10:53 pm
by dizzykiwi3
grump wrote: Wed Aug 30, 2017 10:52 pm What are you doing in your errhand? Where do you provoke the error? Maybe there is no window yet, and you're trying do draw stuff? Move the error to love.draw or love.update.
The error is triggered in the update by a keypress after everything has loaded and drawn for a while. The errhand is verbatim the code from the wiki, which is supposed to be the default blue screen error handler.

Re: Any reason why love.errhand wouldn't work?

Posted: Wed Aug 30, 2017 10:58 pm
by dizzykiwi3
I tested the errhand on a simple one file load, update, draw, and it seems to work there... so something's up with my game

Re: Any reason why love.errhand wouldn't work?

Posted: Wed Aug 30, 2017 11:17 pm
by dizzykiwi3
FOUND IT!

I have a variable named debug, which, according to this post is a no no https://love2d.org/forums/viewtopic.php ... and#p14892

Re: Any reason why love.errhand wouldn't work?

Posted: Thu Aug 31, 2017 1:03 am
by raidho36
The app quits as soon as errhand returns. You need to manually loop forever while drawing error screen and polling for user input, as you would in a normal run function. You're not allowed to error from within error handler.

Re: Any reason why love.errhand wouldn't work?

Posted: Thu Aug 31, 2017 8:19 am
by bartbes
dizzykiwi3 wrote: Wed Aug 30, 2017 11:17 pm FOUND IT!

I have a variable named debug, which, according to this post is a no no https://love2d.org/forums/viewtopic.php ... and#p14892
Yes, love now has a local reference to the actual debug module, which is why the inbuilt error handler doesn't have this problem. If you don't, and you overwrite the debug module it will error again in the error handler, and the game will close.

Also, please don't double post.