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

[Core] Add more details to ParserException #1600

Merged
merged 4 commits into from
Apr 7, 2019

Conversation

zutshiy
Copy link
Contributor

@zutshiy zutshiy commented Apr 7, 2019

Summary

Adding the path to the resource for easier investigation during parsing exceptions in cucumber.

Details

Added resource path to the exception thrown under FeatureParser.parseResource() method to allow user to see which file failed to parse.

Motivation and Context

Better user experience. It is useful to know which file caused the parser exception. Refer slack conversation

Nicolas [Mar 30th at 3:03 AM]
Hello! I'm starting off with cucumber-jvm and I've noticed that the Parser errors don't specify which .feature file is broken. Is there any way to enable this behavior? We're looking at adding multiple feature files at a time in a medium sized QA team and this would help out quite a bit. Thanks!

mpkorstanje [8 days ago]
And if you're willing to invest a little time you could probably submit a patch too:

You'd have to add some details around here I think:

core/src/main/java/cucumber/runtime/model/FeatureParser.java:40
throw new CucumberException(e);

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@zutshiy zutshiy requested a review from mpkorstanje April 7, 2019 08:02
@coveralls
Copy link

coveralls commented Apr 7, 2019

Coverage Status

Coverage remained the same at 86.184% when pulling 15eda70 on gazler22:featureparser-patch into 0caf37c on cucumber:master.

Copy link
Contributor

@mpkorstanje mpkorstanje 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!

@mpkorstanje mpkorstanje changed the title Adding more details to ParserException [Core] Add more details to ParserException Apr 7, 2019
mpkorstanje and others added 2 commits April 7, 2019 19:22
@mpkorstanje mpkorstanje merged commit e117065 into cucumber:master Apr 7, 2019
@mpkorstanje
Copy link
Contributor

Cheers!

@lock
Copy link

lock bot commented Apr 15, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants