Skip to content

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