Skip to content

Commit 47ca84b

Browse files
authored
chore: return queried user on failure to help debug (#9051)
1 parent 1c7bd57 commit 47ca84b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

coderd/httpmw/userparam.go

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package httpmw
22

33
import (
44
"context"
5+
"fmt"
56
"net/http"
67

78
"github.com/go-chi/chi/v5"
@@ -85,6 +86,7 @@ func ExtractUserParam(db database.Store, redirectToLoginOnMe bool) func(http.Han
8586
if err != nil {
8687
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
8788
Message: userErrorMessage,
89+
Detail: fmt.Sprintf("queried user=%q", userQuery),
8890
})
8991
return
9092
}
@@ -96,6 +98,7 @@ func ExtractUserParam(db database.Store, redirectToLoginOnMe bool) func(http.Han
9698
if err != nil {
9799
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
98100
Message: userErrorMessage,
101+
Detail: fmt.Sprintf("queried user=%q", userQuery),
99102
})
100103
return
101104
}

0 commit comments

Comments
 (0)