From f189d040c34cf7ce7e0efa500dd2f8c67ca53f24 Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Wed, 7 Jun 2023 13:24:51 +0200 Subject: [PATCH] handle the bad request status --- changelog/unreleased/fix-drive-response.md | 5 +++++ internal/grpc/services/storageprovider/storageprovider.go | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 changelog/unreleased/fix-drive-response.md diff --git a/changelog/unreleased/fix-drive-response.md b/changelog/unreleased/fix-drive-response.md new file mode 100644 index 0000000000..5f5a3a549b --- /dev/null +++ b/changelog/unreleased/fix-drive-response.md @@ -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 diff --git a/internal/grpc/services/storageprovider/storageprovider.go b/internal/grpc/services/storageprovider/storageprovider.go index 9748db5cc6..e08aff6bdb 100644 --- a/internal/grpc/services/storageprovider/storageprovider.go +++ b/internal/grpc/services/storageprovider/storageprovider.go @@ -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).