diff --git a/pkg/service/v0/validator.go b/pkg/service/v0/validator.go index f523d28d81..3cb7895459 100644 --- a/pkg/service/v0/validator.go +++ b/pkg/service/v0/validator.go @@ -5,7 +5,6 @@ import ( validation "github.com/go-ozzo/ozzo-validation/v4" "github.com/go-ozzo/ozzo-validation/v4/is" - merrors "github.com/micro/go-micro/v2/errors" "github.com/owncloud/ocis-settings/pkg/proto/v0" ) @@ -153,7 +152,7 @@ func validateRemoveRoleFromUser(req *proto.RemoveRoleFromUserRequest) error { // validateResource is an internal helper for validating the content of a resource. func validateResource(resource *proto.Resource) error { if err := validation.Validate(&resource, validation.Required); err != nil { - return merrors.FromError(err) + return err } if err := validation.Validate(&resource, validation.NotIn(proto.Resource_TYPE_UNKNOWN)); err != nil { return err diff --git a/pkg/store/filesystem/bundles.go b/pkg/store/filesystem/bundles.go index e175569d1c..c6a6f6f28d 100644 --- a/pkg/store/filesystem/bundles.go +++ b/pkg/store/filesystem/bundles.go @@ -8,7 +8,6 @@ import ( "sync" "github.com/gofrs/uuid" - merrors "github.com/micro/go-micro/v2/errors" "github.com/owncloud/ocis-settings/pkg/proto/v0" ) @@ -23,7 +22,7 @@ func (s Store) ListBundles(bundleType proto.Bundle_Type) ([]*proto.Bundle, error bundlesFolder := s.buildFolderPathForBundles(false) bundleFiles, err := ioutil.ReadDir(bundlesFolder) if err != nil { - return []*proto.Bundle{}, merrors.FromError(err) + return []*proto.Bundle{}, nil } records := make([]*proto.Bundle, 0, len(bundleFiles)) @@ -74,7 +73,7 @@ func (s Store) ReadSetting(settingID string) (*proto.Setting, error) { } } } - return nil, merrors.NotFound(settingID, fmt.Sprintf("could not read setting: %v", settingID)) + return nil, fmt.Errorf(settingID, fmt.Sprintf("could not read setting: %v", settingID)) } // WriteBundle writes the given record into a file within the dataPath.