Proposal Details
While serving HTTP request we have req.Context() that can be propagated down the pipe. This context can be canceled either by standard library - by http.Server itself in case of communication issues or by http.TimeoutHandler. But also it can be canceled by user code.
It would be nice to have ability to clarify the reason why context was canceled (in case it was canceled by standard library). Logged reason will make you 100% sure and should make investigation of such context cancellation errors easier.
I'm ready to make a PR in case this proposal is considered useful.
Proposal Details
While serving HTTP request we have
req.Context()that can be propagated down the pipe. This context can be canceled either by standard library - byhttp.Serveritself in case of communication issues or byhttp.TimeoutHandler. But also it can be canceled by user code.It would be nice to have ability to clarify the reason why context was canceled (in case it was canceled by standard library). Logged reason will make you 100% sure and should make investigation of such context cancellation errors easier.
I'm ready to make a PR in case this proposal is considered useful.