Hey!
I am making a visual version of Love that will work like Scratch in Love. I know, I dunno why I thought it was a good idea either. xD
I need to build an error handler that won't crash the application, but can crash what the user has made so that the user can see what went wrong. So basically something that will catch the error, show where it was (if possible), and then return to the editing program.
Doable?
Thanks.
Custom Error Handler
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- MicroMacro
- Citizen
- Posts: 92
- Joined: Fri May 30, 2014 2:30 am
- Location: Boston, MA, USA
- Contact:
Custom Error Handler
https://github.com/ebernerd- where you can find all my work.
Re: Custom Error Handler
love.errhand should be what you're looking for.
*Fixed link
*Fixed link
Last edited by davisdude on Fri May 29, 2015 1:54 am, edited 1 time in total.
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
Re: Custom Error Handler
pcall is probably more useful if you want to resume normal operation afterwards: http://www.lua.org/pil/8.4.html
- zorg
- Party member
- Posts: 3444
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Custom Error Handler
I have attached a demo you might find useful (or at least a decent read), since i also experimented with custom error handlers.
I also have a newer, and probably even less buggy (not that the attached one has many...) implementation, but i want to share that via a different way, soon.
I also have a newer, and probably even less buggy (not that the attached one has many...) implementation, but i want to share that via a different way, soon.
- Attachments
-
- rcu.love
- Realtime code editing demo
- (523.22 KiB) Downloaded 133 times
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
- MicroMacro
- Citizen
- Posts: 92
- Joined: Fri May 30, 2014 2:30 am
- Location: Boston, MA, USA
- Contact:
Re: Custom Error Handler
Is there any way that after your error handler it could return to the screen I was using? I'm making a visual version of Love in Love (again, I still don't know why) and I want to catch the errors the users mane and then return them to the screen they were programming on.zorg wrote:I have attached a demo you might find useful (or at least a decent read), since i also experimented with custom error handlers.
I also have a newer, and probably even less buggy (not that the attached one has many...) implementation, but i want to share that via a different way, soon.
https://github.com/ebernerd- where you can find all my work.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 188 guests