Skip to content
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

Improve error classification #2217

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Improve error classification #2217

wants to merge 2 commits into from

Conversation

ceddlyburge
Copy link
Contributor

Most of the wordy exercise is satisfying to complete, but getting the errors correct at the end is very frustrating. The errors themselves seem organised in a non sensical way to me, and getting the tests to pass involves making the code worse, which seems like a bad lesson for a student.

I have hopefully improved the messages, so that:

  • 'unknown operation' is for when you expected an operator (plus, minus etc), but didn't get one.
  • 'syntax error' is for everything else.

I think another option would be to add a third type of error, for when you are expecting an integer, but don't get one, which I would also be open to.

@BethanyG

@glennj
Copy link
Contributor

glennj commented Mar 3, 2023

      "input": {
        "question": "What is 1 2 plus?"
      },
      "expected": {
        "error": "unknown operation"
      }

... unless you're a Forth programmer ;)

@iHiD
Copy link
Member

iHiD commented Mar 4, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants