mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-07 12:50:21 -06:00
Merge pull request #6469 from 2403905/issue-6414
Handle the bad request status for the CreateStorageSpace function
This commit is contained in:
7
changelog/unreleased/fix-drive-response.md
Normal file
7
changelog/unreleased/fix-drive-response.md
Normal file
@@ -0,0 +1,7 @@
|
||||
Bugfix: Handle the bad request status
|
||||
|
||||
Handle the bad request status for the CreateStorageSpace function
|
||||
|
||||
https://github.com/owncloud/ocis/pull/6469
|
||||
https://github.com/cs3org/reva/pull/3948
|
||||
https://github.com/owncloud/ocis/issues/6414
|
||||
@@ -325,6 +325,11 @@ func (g Graph) CreateDrive(w http.ResponseWriter, r *http.Request) {
|
||||
errorcode.NotAllowed.Render(w, r, http.StatusForbidden, "permission denied")
|
||||
return
|
||||
}
|
||||
if resp.GetStatus().GetCode() == cs3rpc.Code_CODE_INVALID_ARGUMENT {
|
||||
logger.Debug().Str("grpcmessage", resp.GetStatus().GetMessage()).Msg("could not create drive: bad request")
|
||||
errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, resp.GetStatus().GetMessage())
|
||||
return
|
||||
}
|
||||
logger.Debug().Interface("grpcmessage", csr).Str("grpc", resp.GetStatus().GetMessage()).Msg("could not create drive: grpc error")
|
||||
errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, resp.GetStatus().GetMessage())
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user