Skip to content

Commit

Permalink
handle the bad request status
Browse files Browse the repository at this point in the history
  • Loading branch information
2403905 committed Jun 7, 2023
1 parent a237504 commit f189d04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-drive-response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Handle the bad request status

Handle the bad request status for the CreateStorageSpace function

https://github.com/cs3org/reva/pull/3948
2 changes: 2 additions & 0 deletions internal/grpc/services/storageprovider/storageprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ func (s *service) CreateStorageSpace(ctx context.Context, req *provider.CreateSt
}
case errtypes.AlreadyExists:
st = status.NewAlreadyExists(ctx, err, "already exists")
case errtypes.BadRequest:
st = status.NewInvalid(ctx, err.Error())
default:
st = status.NewInternal(ctx, "error creating space")
appctx.GetLogger(ctx).
Expand Down

0 comments on commit f189d04

Please sign in to comment.