Page 1 of 1

Close the love window upon error?

Posted: Thu Dec 11, 2014 2:51 am
by parallax7d
currently if there is an error the love window will display it. Since I already get that error printed out to my shell, it's kind of redundant. Would there be a way to have the love window automatically close as soon as it's done printing the error?

Re: Close the love window upon error?

Posted: Thu Dec 11, 2014 3:13 am
by Zilarrezko
You're looking for this.

In basics, you can just take out the while loop at the end of the love.errhand function.

Have fun!

Re: Close the love window upon error?

Posted: Thu Dec 11, 2014 9:34 am
by Germanunkol
If you want to hide the error from users and instead display a nice "user friendly" error message, another option is to use pcall around everything you call from the love.load, love.draw, love.update etc. functions. Then you can catch the errors and do with them whatever you want to.

Re: Close the love window upon error?

Posted: Thu Dec 11, 2014 4:19 pm
by parallax7d
Perfect, thanks Zilarrezko!

Germanunkol, that's not a bad idea. You could conceivably have a few options for the user, like restart game at last save, send in report, or even have a secret hidden minigame that you can only access when your game crashes! :awesome:

Re: Close the love window upon error?

Posted: Thu Dec 11, 2014 6:42 pm
by Germanunkol
Exactly.

Haha, I love the idea with the minigame :D

Re: Close the love window upon error?

Posted: Thu Dec 11, 2014 8:21 pm
by Azhukar
parallax7d wrote:hidden minigame that you can only access when your game crashes
Better patent it before someone else does or you'll be unable to do it for the next 20 years.

Re: Close the love window upon error?

Posted: Thu Dec 11, 2014 8:37 pm
by davisdude
I'm assuming you're pointing at nobody in particular (*cough* *cough* Namco and loading games *cough* *cough*).