Open kayrus opened 2 years ago
How does net/http
handle this?
@emersion net/http
's serve
method doesn't return err, it passes it to the ErrorLog
handler.
Hm, and ErrorLog
seems to be used for many kinds of failures, both server-side panics, TLS handshakes and handler errors.
BTW, I noticed more limitations in ErrorLog
handler:
"%v", err
instead of the "%w", err
). c.State()
If I'd have a logging struct satisfying the ErrorLog
interface, I'd like to have an ability to get the original error and the TCP connection state data.
There there is no way to catch errors, returned by handleConn method: https://github.com/emersion/go-smtp/blob/30169acc42e795e5d35ce901c8387950b103dfd9/server.go#L124
https://github.com/emersion/go-smtp/blob/30169acc42e795e5d35ce901c8387950b103dfd9/server.go#L128