Skip to content

Catch parameter transform errors #766

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

Closed
wants to merge 5 commits into from

Conversation

aslakhellesoy
Copy link
Contributor

This is a fix for #765. It depends on #764 and is branched off from the cucumber-expressions-2.0.0 branch.

@aslakhellesoy aslakhellesoy changed the base branch from master to cucumber-expressions-2.0.0 February 18, 2017 01:09
Copy link
Member

@charlierudolph charlierudolph left a comment

Choose a reason for hiding this comment

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

Awesome @aslakhellesoy! What do your think about merging this into #764 and adding #753 to that PR as well? They are all interrelated and dependent on one another anyway.

error = stepDefinition.getInvalidCodeLengthMessage(parameters)

try {
const parameters = stepDefinition.getInvocationParameters({scenarioResult, step, parameterRegistry})
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer we only have the try/catch around this statement. I like try/catch to be very isolated to prevent it from catching errors we don't want it to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in a071aab

@aslakhellesoy
Copy link
Contributor Author

What do your think about merging this into #764 and adding #753 to that PR as well? They are all interrelated and dependent on one another anyway.

Personally I'd merge them to master independently. They're related, but independent discrete improvements. I'd merge #764 first, then #766 (this one) and finally #753 (which would have to merged/rebased with master first).

I'm going away for a week, so I won't have time to address the code review feedback on those PRs, but I agree with all of them, so feel free to fix them while I'm gone :-)

@aslakhellesoy aslakhellesoy force-pushed the catch-parameter-transform-errors branch from 4f0d65f to e5f317e Compare February 18, 2017 20:31
@aslakhellesoy
Copy link
Contributor Author

I found some time to address feedback. This should be ready to merge now I think.

error = err
}

if(!error) {
Copy link
Member

Choose a reason for hiding this comment

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

@aslakhellesoy missing space (:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

npm run eslint is happy. Feel free to add more strict rules if you think it's helpful.

Copy link
Member

Choose a reason for hiding this comment

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

I do wish eslint caught this but regardless I would still like a space added here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think it would be fair to call that out as pedantic?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. But I think it helps with readability which is important.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Readability is important. But even more important is to display appreciation for contributions. When you nitpick like this it can easily be interpreted as "I'm never going to live up to this guy's standards", and that turns contributors away.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We've all got our pet peeves, I certainly have mine. That doesn't mean we need to share them with everyone. If minor formatting issues like this bugs you I suggest you tweak the linting rules, or write your own if you can't find rules that are strict enough for your liking.

Or just cut people some white space slack and fix it yourself after you merge.

Copy link
Member

Choose a reason for hiding this comment

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

I agree a linter would be ideal here but I don't really see the different between a linter and me asking for a whitespace change.


But even more important is to display appreciation for contributions.

Does me saying "Awesome @aslakhellesoy!" earlier in this PR not count? Anytime I merge a PR, I always have a "Thank you" comment after and try to comment on the PR letting the user know when the change has been released.


We've all got our pet peeves, I certainly have mine.

One of mine is to actually have all the keys of an object sorted. This was something that got messed up in a previous PR. That I did not think was worth asking you to do.


If minor formatting issues like this bugs you I suggest you tweak the linting rules, or write your own if you can't find rules that are strict enough for your liking.

I have done this in the past for other issues and if this becomes a common problem I would certainly look into it. But I haven't really run into this much as the general styling is all I'm asking. A line of whitespace between functions. A space between an if and the paren.


Thank you for the PRs. I'll take care of merging them and dealing the my comments

@aslakhellesoy aslakhellesoy force-pushed the cucumber-expressions-2.0.0 branch from 2df2293 to 72c3d4a Compare March 9, 2017 09:59
@aslakhellesoy aslakhellesoy force-pushed the catch-parameter-transform-errors branch from a071aab to 26169b5 Compare March 9, 2017 15:48
@aslakhellesoy
Copy link
Contributor Author

I've rebased this on top of #764 - should be ready to merge

error = err
}

if(!error) {
Copy link
Member

Choose a reason for hiding this comment

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

I do wish eslint caught this but regardless I would still like a space added here.

@charlierudolph charlierudolph changed the base branch from cucumber-expressions-2.0.0 to master March 9, 2017 23:54
@charlierudolph charlierudolph reopened this Mar 9, 2017
charlierudolph added 2 commits March 9, 2017 15:55
# Conflicts:
#	features/custom_parameter.feature
#	src/runtime/step_runner.js
@charlierudolph charlierudolph deleted the catch-parameter-transform-errors branch March 9, 2017 23:58
@lock
Copy link

lock bot commented Oct 25, 2018

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 Oct 25, 2018
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