async-h1
async-h1 copied to clipboard
Error handling
An Error always has an associated StatusCode. From this, I assumed that errors are converted into HTTP responses when using the accept function.
However, that does not seem to be the case. The errors are just propagated, which results in a connection closing without a response:
https://github.com/http-rs/async-h1/blob/5606a9d85f069f12b66120fc4bbfe065a8ad6155/src/server/mod.rs#L75
Should this be handled automatically by accept, or is this the job of the user? If the latter, then what is the advantage of the StatusCode requirement for errors?