Closed DaWoCX closed 8 months ago
Hello there DaWoCX 👋
Thank you for opening your very first issue in this project.
We will try to get back to you as soon as we can.👀
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
Error thrown in custom middleware are not caught or handled by the provided error handler
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
I have a custom middleware which authenticates a request based on some content in the request header. If the request is not valid I throw an custom AUTHENTCATION_ERROR. I Would expect that the error would be caught in the error handler added to express by using "app.use(...)" like shown in the tsoa documentation.
I would expect the error handler to catch those errors just like the errors were caught using the tsoa expressAuthentication function / @Security decorator.
Current Behavior
Currently the error is not caught in the error handler. It just is thrown as expected and the app crashes.
Possible Solution
Steps to Reproduce
Context (Environment)
Version of the library: 5.1.1 Version of NodeJS: 20.9.0