Error handling#116
Open
Puh00 wants to merge 6 commits into
Open
Conversation
✅ Deploy Preview for learnypy ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
yenanw
reviewed
May 24, 2022
| <li>Many iterations will make the website slow.</li> | ||
| <li>Only Python 3.7.3 grammar is supported.</li> | ||
| <li>A few Python libraries are supported.</li> | ||
| <li>Debugger is unable to suspend correctly when importing Python modules.</li> |
Collaborator
There was a problem hiding this comment.
noice! but this message might be a bit confusing for the average users, maybe something like "Importing Python modules might not always work correctly".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Made some changes here and there to make the LearnyPy less prone to errors. For instance the following code snippet didn't work before (when you run the entire program at once)
Also added a try catch for dotGenerator so it doesn't crasch the web application. Tried writing a custom error message to the outputbox but was unable to since Skulpt was overwriting my message with some output that isn't really helpful for the user. Maybe someone else can have a look at it. My approach was to pass an extra parameter
output_texttorestart_callback()that by default has an empty string, which is later passed on to restart:skulpt.restart(prog, () => clear_visuals(output_text), false);. Then I modified the promise in skulpt.restart to this:Even with the
finally(...thedebugger.errorstill overwrites the custom message passed in the callback function.I'm also pretty sure that the issue with imports won't be easy to fix. Skulpt even state here that this is a known issue. I even found a master thesis that created their own debugger for skulpt and they also have the same issue (link to their web app). I've added this issue to the known limitations in the about page for now.