Close the love window upon error?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
parallax7d
Citizen
Posts: 82
Joined: Wed Jul 02, 2014 11:44 pm

Close the love window upon error?

Post 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?
User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

Re: Close the love window upon error?

Post 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!
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Close the love window upon error?

Post 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.
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
User avatar
parallax7d
Citizen
Posts: 82
Joined: Wed Jul 02, 2014 11:44 pm

Re: Close the love window upon error?

Post 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:
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Close the love window upon error?

Post by Germanunkol »

Exactly.

Haha, I love the idea with the minigame :D
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
User avatar
Azhukar
Party member
Posts: 478
Joined: Fri Oct 26, 2012 11:54 am

Re: Close the love window upon error?

Post 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.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Close the love window upon error?

Post by davisdude »

I'm assuming you're pointing at nobody in particular (*cough* *cough* Namco and loading games *cough* *cough*).
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 45 guests