6.12.1: Error Handling

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

6.12.1: Error Handling

#1 Post by PyTom » Thu Mar 31, 2011 8:38 pm

This is the first in a series of posts about some of the new features that will be released in Ren'Py 6.12.1 - which I hope to make a pre-release of relatively soon. The goal of this, and the next few releases, is to make life easier for game-makers.

I'll start off with the new error handling feature. Previously, a Ren'Py exception was reported by the game crashing, and then (depending on platform) an error message coming up on the screen. While easy to implement, this behavior didn't have much to recommend it - it made fixing the bugs more painful then they need be.

Here's a screenshot of the error handling in 6.12.1:
Screenshot-The Ren'Py Tutorial Game-2.png
When an exception occurs that Ren'Py is capable of catching, this screen pops up. It displays a small, censored traceback at the top of the screen, showing the bits of Ren'Py code that were involved in the stack trace. When an editor is configured, you can click on the line numbers (in blue) to launch that file in a text editor.

At the bottom of the screen, there are a number of options. (The precise options shown vary based on when the error occurs.)

Rollback Choosing this option causes Ren'Py to rollback to the previous screen. For the end user, this is probably the best possible choice, as it puts him into a position to save the game.

Ignore It's often possible to try to determine what the next statement is early in the execution of a statement - for example, when the say statement runs, it will always go through to the next statement. When this is possible, the Ignore button will let the user skip through to the next statement. This can lead to errors - such as when the user Ignores a failing python block - but it may be better than nothing, especially if the game is no longer supported by the creator.

Reload is only available when config.developer is set. This reloads the game - similar to shift+R reload. This is probably what developers will use the most, as it supports a fix-the-bug-and-continue style of debugging.

Open Traceback opens the traceback in a text editor. This is what we have now - but since the new code shows the traceback on screen, it's only necessary to click this if you want to send the traceback to the maker.

Quit quits Ren'Py. Do not pass go - etc.

I figured I'd show this a bit early so that people can get used to it, and make suggestions. I'm considering adding a plug-in system that allows user code to add buttons to this screen - but the problem is that we're in a really weird state here, and I'm not sure how well it would work.

This also shows the new Ren'Py "House Style" that will be used for Ren'Py specific screens - exception handling, display troubleshooting options, the style inspector, and eventually things like the new launcher. These screens (and the styles they use) should be considered part of Ren'Py, that only advanced or very unlucky users would ever see - they aren't meant to be customized by the game-maker.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
SleepKirby
Veteran
Posts: 255
Joined: Mon Aug 09, 2010 10:02 pm
Projects: Eastern Starlight Romance, Touhou Mecha
Organization: Dai-Sukima Dan
Location: California, USA
Contact:

Re: 6.12.1: Error Handling

#2 Post by SleepKirby » Fri Apr 01, 2011 12:56 am

Ooh, this could be quite handy - it'd be great to fix errors without having to restart the game fully. Looking forward to it! (I think the style looks nice too.)

To clarify, does the new error handling kick in for any case where Ren'Py 6.12.0 would open traceback.txt (as opposed to errors.txt)?

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: 6.12.1: Error Handling

#3 Post by PyTom » Fri Apr 01, 2011 1:02 am

SleepKirby wrote:To clarify, does the new error handling kick in for any case where Ren'Py 6.12.0 would open traceback.txt (as opposed to errors.txt)?
That's the intent. I'm sure that the are some errors where the system will be so broken that it may fall back to the old handling, but in the majority of cases, this should work.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4067
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: 6.12.1: Error Handling

#4 Post by jack_norton » Fri Apr 01, 2011 3:30 am

Can you also add a "Email" button?
I guess since you can display the traceback.txt on screen would be useful (during development) to allow user to click that button and using urrlib you can do mailto: to automatically compose the email with the traceback.txt as message body. Would be very useful I think.
follow me on Image Image Image
computer games

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: 6.12.1: Error Handling

#5 Post by Aleema » Fri Apr 01, 2011 5:08 am

Can you copy/paste from this version or will it need to be opened up first?

It looks nifty, but I'll need to work with it personally before I can really say how it works. I've gotten used to the latest handling system, but then, I also hacked my editor so it wouldn't open up a new instance of my script every time I got an error, so this will hopefully kill that for those who haven't hacked their editor and hate all those new windows.

User avatar
Midnighticequeen
Veteran
Posts: 292
Joined: Fri Apr 04, 2008 4:04 pm
Completed: Bunni and Kitty, Sweethearts, Tiesa's Tales
Projects: Wish
Organization: Ice Queen Games
itch: icequeenstudios
Contact:

Re: 6.12.1: Error Handling

#6 Post by Midnighticequeen » Fri Apr 01, 2011 8:34 am

It looks nifty, but I'll need to work with it personally before I can really say how it works. I've gotten used to the latest handling system, but then, I also hacked my editor so it wouldn't open up a new instance of my script every time I got an error, so this will hopefully kill that for those who haven't hacked their editor and hate all those new windows.
:shock: I LOVE that idea!

And as much I like the new interface, I certainly wouldn't like to see it to often, if you know what I mean. :D

Hmm...if there's one thing I would love for the error handling to display is like, a suggestion option. Like, if I'm not displaying my code right and the error message came up, I would like it if Renpy could configure a list of likely possibilities of what I'm trying to do and suggest a list with a sample of the codes that it thinks I'm trying to do.

But such a thing, might take a lot of time and effort and might be completely time consuming.
:oops: Sorry, I'll just shut up now.

User avatar
papillon
Arbiter of the Internets
Posts: 4104
Joined: Tue Aug 26, 2003 4:37 am
Completed: lots; see website!
Projects: something mysterious involving yuri, usually
Organization: Hanako Games
Tumblr: hanakogames
Contact:

Re: 6.12.1: Error Handling

#7 Post by papillon » Fri Apr 01, 2011 9:07 am

Yay! (poor spiky, after I put him through all that work to build a similar system... Ours mostly works, but still occasionally falls back to old behavior, and also tends to crash thoroughly if you rollback from the error screen and then go forward to the same error)

The ability to add a custom button or two would be very much appreciated, since the one thing our version has different is the "upload traceback" button which automatically sends the tb to spiky, through a server that checks known issues and may prompt people to patch. It's been very convenient for getting people to report errors without having to take the time to make a post/mail about them. However, I can't provide any details about the behind the scenes code, I have no idea what he's doing in there. :)

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: 6.12.1: Error Handling

#8 Post by PyTom » Fri Apr 01, 2011 10:32 am

jack_norton wrote:Can you also add a "Email" button?
I guess since you can display the traceback.txt on screen would be useful (during development) to allow user to click that button and using urrlib you can do mailto: to automatically compose the email with the traceback.txt as message body. Would be very useful I think.
I don't think urllib lets you do this.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4067
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: 6.12.1: Error Handling

#9 Post by jack_norton » Fri Apr 01, 2011 10:51 am

Actually I tried and is enough to use this:

Code: Select all

    python hide:
        import webbrowser
        webbrowser.open_new('mailto:info@winterwolves.com')
        renpy.quit()
at least on PC works! :) not sure about Linux/Mac ?
follow me on Image Image Image
computer games

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: 6.12.1: Error Handling

#10 Post by PyTom » Fri Apr 01, 2011 12:41 pm

That works to send an email, but (at least for me) I can't fill in the subject or body.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4067
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: 6.12.1: Error Handling

#11 Post by jack_norton » Fri Apr 01, 2011 12:47 pm

I found a good tutorial here: http://www.ianr.unl.edu/internet/mailto.html

I tried this and works:

Code: Select all

webbrowser.open_new('mailto:sub@winterwolves.com?subject=BUG!?&body=this is a traceback.txt')
follow me on Image Image Image
computer games

Friendbot2000
Regular
Posts: 161
Joined: Tue Feb 15, 2011 8:00 pm
Projects: Mutagen : Journey to Haven's Landing
Contact:

Re: 6.12.1: Error Handling

#12 Post by Friendbot2000 » Wed Apr 13, 2011 12:06 pm

I absolutely love this new addition. It would make debugging do much easier! I hate having to weed through my game to test a certain piece of code.
The prospect of having error codes mailed to you is possible. I have seen it done in one of the programming classes I help teach. I don't know how to implement it because I have never had much use for it. Do you want me to save you some time by researching it Pytom?
Last edited by Friendbot2000 on Fri Apr 15, 2011 12:58 pm, edited 1 time in total.
Visit my game development group's Facebook page : Timekeeper Games
Mutagen : Journey to Haven's Landing Facebook Page
Follow our Twitter feed too : TK Games

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4067
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: 6.12.1: Error Handling

#13 Post by jack_norton » Wed Apr 13, 2011 12:25 pm

I tried "hacking" the new screen error, but apparently the webbrowser.open_new() doesn't work with mailto: inside a def func() of python. I tried opening a URL and works, so in theory you could open a webpage and pass parameters somehow... even if an email would be nicer :)
follow me on Image Image Image
computer games

Post Reply

Who is online

Users browsing this forum: No registered users