Replies: 1 comment
-
Hi @jeroen You can debug your application. It would allow you to see the execution calls and find out where it hangs. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to detect a bug in my express 5 app where a request has been handled by express, but it somehow did not send a response to the client. This results in leaving the client hanging and is difficult to debug.
A typical scenario in which this occurs is when a router code does something async in a promise, but you forgot to
return
this promise in the router. In this case, when the promise gets rejected, express will not catch it and send a error message to the client.What I need is a hook or type of middleware (postware?) that always runs after express is done with the request, including waiting for a promise returned by the router to get settled and running the error handler on rejection. Once all this has completed I want to run a final check if anything has actually been sent to the client.
I understand this does not work for express applications in general, because it requires routers always
return
the promise that will sending a response, which express does not require. But I think it is good practice and it will make it possible to use such a postware handler.Beta Was this translation helpful? Give feedback.
All reactions