From c1a4f7a238fd8f710a02cc8ec94cab46e0d1d848 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Tue, 25 Aug 2020 10:40:44 +0200 Subject: [PATCH] Fix error on missing permissions for GetBundle --- pkg/service/v0/service.go | 2 ++ pkg/store/filesystem/bundles.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index d6622c949..4596d1182 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -2,6 +2,7 @@ package svc import ( "context" + "fmt" "github.com/golang/protobuf/ptypes/empty" merrors "github.com/micro/go-micro/v2/errors" @@ -75,6 +76,7 @@ func (g Service) GetBundle(c context.Context, req *proto.GetBundleRequest, res * roleIDs := g.getRoleIDs(c, accountUUID) filteredBundle := g.getFilteredBundle(roleIDs, bundle) if len(filteredBundle.Settings) == 0 { + err = fmt.Errorf("could not read bundle: %v", req.BundleId) return merrors.NotFound("ocis-settings", "%s", err) } res.Bundle = filteredBundle diff --git a/pkg/store/filesystem/bundles.go b/pkg/store/filesystem/bundles.go index c6a6f6f28..3f2b4088b 100644 --- a/pkg/store/filesystem/bundles.go +++ b/pkg/store/filesystem/bundles.go @@ -73,7 +73,7 @@ func (s Store) ReadSetting(settingID string) (*proto.Setting, error) { } } } - return nil, fmt.Errorf(settingID, fmt.Sprintf("could not read setting: %v", settingID)) + return nil, fmt.Errorf("could not read setting: %v", settingID) } // WriteBundle writes the given record into a file within the dataPath.