mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-15 14:10:34 -04:00
apply review comments
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user