From 03475eb0af784b2e6403a7273185ca1034dc400e Mon Sep 17 00:00:00 2001 From: Sammy Kerata Oina <44265300+SammyOina@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:24:05 +0300 Subject: [PATCH] MF-1749 - Remove duplicate case in error handling Signed-off-by: SammyOina --- users/api/transport.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/users/api/transport.go b/users/api/transport.go index dcdb8d27..9916317b 100644 --- a/users/api/transport.go +++ b/users/api/transport.go @@ -338,8 +338,7 @@ func encodeError(_ context.Context, err error, w http.ResponseWriter) { w.WriteHeader(http.StatusUnauthorized) case errors.Contains(err, errors.ErrAuthorization): w.WriteHeader(http.StatusForbidden) - case errors.Contains(err, errors.ErrConflict), - errors.Contains(err, errors.ErrConflict): + case errors.Contains(err, errors.ErrConflict): w.WriteHeader(http.StatusConflict) case errors.Contains(err, errors.ErrUnsupportedContentType): w.WriteHeader(http.StatusUnsupportedMediaType)