From d758ee5d742c7882b9025c5cadddff90c5758aa6 Mon Sep 17 00:00:00 2001 From: Josh Freda Date: Wed, 6 Sep 2023 12:08:49 -0500 Subject: [PATCH] Log user for 'wrong number of people in search result' error --- internal/api/me.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/internal/api/me.go b/internal/api/me.go index 4bb0a661d..014762cee 100644 --- a/internal/api/me.go +++ b/internal/api/me.go @@ -60,11 +60,15 @@ func MeHandler( return case "GET": - errResp := func(httpCode int, userErrMsg, logErrMsg string, err error) { + errResp := func( + httpCode int, userErrMsg, logErrMsg string, err error, + extraArgs ...interface{}) { l.Error(logErrMsg, - "method", r.Method, - "path", r.URL.Path, - "error", err, + append([]interface{}{ + "error", err, + "method", r.Method, + "path", r.URL.Path, + }, extraArgs...)..., ) http.Error(w, userErrMsg, httpCode) } @@ -87,7 +91,8 @@ func MeHandler( "Error getting user information", fmt.Sprintf( "wrong number of people in search result: %d", len(ppl)), - err, + nil, + "user_email", userEmail, ) return }