-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🖊️ Add user-friendly errors for calculations with incorrect types #3465 #5226
Conversation
00dac5b
to
ed3f4b5
Compare
66cd199
to
7bc7454
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, Boryana! This works great, thank you so much :D
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
… (#5226) Fixes #3465 Add custom error message when calculations are passed incompatible types. **How to test** - All automated tests should pass - Run Hedy locally and navigate to specified level. Run the following code and supply a string instead of a number. Ensure that there is a nice error displayed and no python error leaks: Level 6 ``` hoeken = ask 'Hoeveel hoeken krijgt dit figuur?' hoek = 360 / hoeken print hoek ``` Level 12 ``` hoeken = ask 'Hoeveel hoeken krijgt dit figuur?' hoek = 360 / hoeken print hoek ``` Level 12. Note that addition should show a different error since concatenation works from level 12. ``` hoeken = ask 'Hoeveel hoeken krijgt dit figuur?' hoek = 360 + hoeken print hoek ```
Fixes #3465
Add custom error message when calculations are passed incompatible types.
How to test
Level 6
Level 12
Level 12. Note that addition should show a different error since concatenation works from level 12.