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

Handle param middleware errors #12

Merged
merged 3 commits into from
Oct 12, 2018

Conversation

kronicker
Copy link
Collaborator

@kronicker kronicker commented Oct 1, 2018

This PR aims to resolve #8

  • Common wrap function is added with function parity preservation to enable acceptance of an arbitrary number of params in wrapped middleware functions. This is possible cause of the fact that next is always the last argument. The only exception is .param middleware which is pinpointed by the only one having 5 arguments (req, res, next, paramValue, paramName).
  • Router.prototype.constructor.param method is patched and middleware function is wrapped to catch errors
  • Test for .param error handling is added

@davidbanham
Copy link
Owner

Thanks for the PR, @kronicker ! Just wanted to drop a quick note to say I've seen this. I'll hopefully have time to review over the next couple of days and I'll get back to you asap.

@davidbanham davidbanham merged commit 74d7393 into davidbanham:master Oct 12, 2018
@davidbanham
Copy link
Owner

Merged and released as 3.1.0. Many thanks!

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.

Doesn't work when using router.param
2 participants