zio-http
zio-http copied to clipboard
Netty pipeline errors cannot be observed by middleware
This means requests rejected by Netty, for example due to request size (default 100kb) will silently fail while responding 413, and no request logging or metric middleware will be able to observe this and likely some other failure modes.
See https://discord.com/channels/629491597070827530/819703129267372113/1217054850966229082
This is a problem because middleware only affects requests and responses. So there's no nice way to model pipeline errors.
The ideal solution would be a "middleware tower", where the highest level can handle any handler, the lower level can handle request/response. However, I think that's probably out of scope for ZIO HTTP 3.0
This is a problem because middleware only affects requests and responses. So there's no nice way to model pipeline errors.
The ideal solution would be a "middleware tower", where the highest level can handle any handler, the lower level can handle request/response. However, I think that's probably out of scope for ZIO HTTP 3.0
Sounds good to me! Any plans on adding a level like that after 3.0? It would also be quite helpful for things like capturing lower level errors in middleware I think, which is a separate but somewhat related topic. Such as capturing a stack trace in an error logging middleware.
@jdegoes do you mean 3.0 or 3.x?