From 4c3df7277d298afc2cb5d7c8919152257a9292f7 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Thu, 9 Mar 2023 14:07:05 +0100 Subject: [PATCH] return the correct status code when updating a share fails --- services/graph/pkg/service/v0/drives.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/graph/pkg/service/v0/drives.go b/services/graph/pkg/service/v0/drives.go index 398bc29c38..9842c10ca2 100644 --- a/services/graph/pkg/service/v0/drives.go +++ b/services/graph/pkg/service/v0/drives.go @@ -444,6 +444,10 @@ func (g Graph) UpdateDrive(w http.ResponseWriter, r *http.Request) { logger.Debug().Interface("id", rid).Msg("could not update drive, permission denied") errorcode.NotAllowed.Render(w, r, http.StatusForbidden, resp.GetStatus().GetMessage()) return + case cs3rpc.Code_CODE_INVALID_ARGUMENT: + logger.Debug().Interface("id", rid).Msg("could not update drive, invalid argument") + errorcode.NotAllowed.Render(w, r, http.StatusBadRequest, resp.GetStatus().GetMessage()) + return default: logger.Debug().Interface("id", rid).Str("grpc", resp.GetStatus().GetMessage()).Msg("could not update drive: grpc error") errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, resp.GetStatus().GetMessage())