mirror of
https://github.com/minio/minio.git
synced 2025-01-23 20:53:18 -05:00
AddNode fails with proper error code when bucketid is malformed
This commit is contained in:
parent
8cf66ede66
commit
70a2217eb2
@ -23,12 +23,10 @@ func (b donutBucket) GetNodes() ([]string, error) {
|
||||
|
||||
// AddNode - adds a node to a bucket
|
||||
func (b donutBucket) AddNode(nodeID, bucketID string) error {
|
||||
errParams := map[string]string{"node": nodeID, "bucketID": bucketID}
|
||||
tokens := strings.Split(bucketID, ":")
|
||||
if len(tokens) != 3 {
|
||||
var err error
|
||||
err = iodine.Error(nil, nil)
|
||||
return err
|
||||
// return iodine.Error(errors.New("Bucket ID malformed: "+bucketID), map[string]string{"nodeID": nodeID, "bucketID": bucketID})
|
||||
return iodine.Error(errors.New("Bucket ID malformeD: "+bucketID), errParams)
|
||||
|
||||
}
|
||||
// bucketName := tokens[0]
|
||||
@ -36,7 +34,7 @@ func (b donutBucket) AddNode(nodeID, bucketID string) error {
|
||||
// aggregate := "0"
|
||||
part, err := strconv.Atoi(tokens[2])
|
||||
if err != nil {
|
||||
return iodine.Error(errors.New("Part malformed: "+tokens[2]), map[string]string{"nodeID": nodeID, "bucketID": bucketID})
|
||||
return iodine.Error(errors.New("Part malformed: "+tokens[2]), errParams)
|
||||
}
|
||||
b.nodes[part] = nodeID
|
||||
return nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user