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

Cope with unhandled rejected promises in /token handler #142

Merged
merged 1 commit into from
Nov 17, 2021

Conversation

nulltoken
Copy link
Contributor

Fix #141

PR Checklist

  • I have run npm test locally and all tests are passing.
  • I have added/updated tests for any new behavior.
  • If this is a significant change, an issue has already been created where the problem / solution was discussed: [N/A, or add link to issue here]

PR Description

Express 4.x doesn't properly cope with rejected promises by default.
Delegating to next() invokes the standard error handler.

@nulltoken
Copy link
Contributor Author

@poveden Not ready yet. I still have to write a unit test to prove the code does what it's supposed to do.

Express 4.x doesn't properly cope with rejected promises by default.
Delegating to next() invokes the standard error handler.
@nulltoken
Copy link
Contributor Author

@poveden Ready for review. Sorry for the diff noise. It looks like a big chunk of change, but it was really a matter of wrapping the token handler in a try/catch.

I've also taken the opportunity to create #143

@nulltoken nulltoken changed the title [WIP] Cope with unhandled rejected promises in /token handler Cope with unhandled rejected promises in /token handler Nov 17, 2021
@nulltoken nulltoken merged commit 57dd4ba into master Nov 17, 2021
@nulltoken nulltoken deleted the ntk/issue_141 branch November 17, 2021 18:25
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.

Token requests can trigger a "UnhandledPromiseRejectionWarning" in version 4.0.0+
2 participants