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

Validate next parameter to ensure it's a function #773

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davich
Copy link

@davich davich commented May 10, 2020

This checks that the next parameter is a function, and if it is not, throws a detailed error message.

I battled with a confusing error message from a line deep within the strategy file because I forgot to pass in the next parameter (I just passed in 'req, res'). An error message like the one I've added would have made it obvious what I'd done wrong. I'm hoping this might stop others who encounter this in the future.

Previously raised an issue here: jaredhanson/passport-oauth2#124.

Checklist

  • [x ] I have read the CONTRIBUTING guidelines.
  • I have added test cases which verify the correct operation of this feature or patch.
  • I have added documentation pertaining to this feature or patch.
  • [x ] The automated test suite ($ make test) executes successfully.
  • The automated code linting ($ make lint) executes successfully.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 98.607% when pulling e6a44bc on davich:validate-type-of-next-parameter into 42ff63c on jaredhanson:master.

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.

2 participants