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

run: handle parse errors better #1951

Merged
merged 6 commits into from
Mar 8, 2022
Merged

run: handle parse errors better #1951

merged 6 commits into from
Mar 8, 2022

Conversation

davidjgoss
Copy link
Contributor

@davidjgoss davidjgoss commented Mar 4, 2022

🤔 What's changed?

Don't throw immediately when a parse error is encountered by gherkin - instead ensure all the errors (as well as any valid sources) are emitted and do a normal cleanup and exit.

Avoided making this part of parseGherkinMessageStream because that's on the public API (for now) and I didn't want to make a breaking change to its signature unnecessarily.

⚡️ What's your motivation?

Fixes #1404.

Previously we'd throw on the first parse error and formatters wouldn't have a chance to do anything with it before the process exited.

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

♻️ Anything particular you want feedback on?

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

@coveralls
Copy link

coveralls commented Mar 4, 2022

Coverage Status

Coverage increased (+0.006%) to 98.274% when pulling 1264859 on feat/emit-parse-error into 36ccc1b on main.

@davidjgoss davidjgoss requested review from aurelien-reeves and charlierudolph and removed request for aurelien-reeves March 7, 2022 19:21
Copy link
Contributor

@aurelien-reeves aurelien-reeves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👌

Just a small request to rename the new step definition, but this is an approval 💪

features/gherkin_parse_failure.feature Outdated Show resolved Hide resolved
@davidjgoss davidjgoss merged commit 8f365aa into main Mar 8, 2022
@davidjgoss davidjgoss deleted the feat/emit-parse-error branch March 8, 2022 09:04
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.

Getting the parse error into a variable
3 participants