1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-24 13:48:49 +08:00

MF-1749 - Remove duplicate case in error handling

Signed-off-by: SammyOina <sammyoina@gmail.com>
This commit is contained in:
Sammy Kerata Oina 2023-03-28 16:24:05 +03:00 committed by GitHub
parent 83ff4e12ea
commit 03475eb0af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)