mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-08 20:40:16 -05:00
return 423 on tag create when file is locked
Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
Bugfix: Return 423 status code on tag create
|
||||
|
||||
When a file is locked, return 423 status code instead 500 on tag create
|
||||
|
||||
https://github.com/owncloud/ocis/pull/7596
|
||||
@@ -120,7 +120,11 @@ func (g Graph) AssignTags(w http.ResponseWriter, r *http.Request) {
|
||||
},
|
||||
})
|
||||
if err != nil || resp.GetStatus().GetCode() != rpc.Code_CODE_OK {
|
||||
g.logger.Error().Err(err).Msg("error setting tags")
|
||||
g.logger.Error().Err(err).Interface("status", resp.GetStatus()).Msg("error setting tags")
|
||||
if resp.GetStatus().GetCode() == rpc.Code_CODE_LOCKED {
|
||||
errorcode.InvalidRequest.Render(w, r, http.StatusLocked, "file is locked")
|
||||
return
|
||||
}
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user