deepkit / deepkit-framework

A new full-featured and high-performance TypeScript framework
https://deepkit.io/
MIT License
3.24k stars 123 forks source link

DX: HTTP: throwing @ HTTP Middlewares #589

Open alpharder opened 4 months ago

alpharder commented 4 months ago

Throwing or passing next() an error (even HttpError) results in weird behavior:

Screenshot 2024-07-06 at 9 12 57 AM Screenshot 2024-07-06 at 9 13 36 AM

Expected result would be no Could not resolve request thing with 404 response code, but rather 403 response code with no.

Alternatively, it could be explicitly stated in documentation what is the allowed way of using middlewares (only directly interacting with HttpRequest/HttpResponse) and no other fancy things are allowed.