Skip to content

Return the middleware's result so that async error handling works. - #101

Open
N-McA wants to merge 1 commit into
HenningM:masterfrom
N-McA:master
Open

Return the middleware's result so that async error handling works.#101
N-McA wants to merge 1 commit into
HenningM:masterfrom
N-McA:master

Conversation

@N-McA

@N-McA N-McA commented Aug 1, 2018

Copy link
Copy Markdown

By returning the result of the middleware, promise chaining can be done elsewhere. An example of why this is (very) useful is given by

https://github.com/N-McA/express-ws-async-error-fail-example

Which shows the lack of interoperability that occurs without the suggested change.

@anistark

anistark commented Mar 3, 2020

Copy link
Copy Markdown

@N-McA On node 12.5.0 I'm getting error TypeError: middleware is not a function.
Adding return didn't help.

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