Add log warn when request is cancelled/interrupted

This commit is contained in:
Deluan
2022-07-27 14:27:18 -04:00
parent cd5bce7b16
commit c0066ebd85
2 changed files with 15 additions and 3 deletions
+4
View File
@@ -192,6 +192,10 @@ func h(r chi.Router, path string, f handler) {
sendError(w, r, err)
return
}
if r.Context().Err() != nil {
log.Warn("Request was interrupted", "path", path, r.Context().Err())
return
}
if res != nil {
sendResponse(w, r, res)
}