Add request ID to error reports

This commit is contained in:
DarthSim
2024-03-10 21:12:43 +03:00
parent a31e4e7c79
commit 01b053277d
2 changed files with 3 additions and 1 deletions

View File

@@ -135,6 +135,8 @@ func withPanicHandler(h router.RouteHandler) router.RouteHandler {
ctx := errorreport.StartRequest(r)
r = r.WithContext(ctx)
errorreport.SetMetadata(r, "Request ID", reqID)
defer func() {
if rerr := recover(); rerr != nil {
if rerr == http.ErrAbortHandler {