Improved error message in ECClient (#214)
* Improved error message in ECClient * Fixed broken test
This commit is contained in:
parent
5f8142cdcc
commit
ffaebb57df
@ -62,7 +62,8 @@ func (ec *ecClient) Put(ctx context.Context, nodes []*proto.Node, rs eestream.Re
|
||||
pieceID client.PieceID, data io.Reader, expiration time.Time) (err error) {
|
||||
defer mon.Task()(&ctx)(&err)
|
||||
if len(nodes) != rs.TotalCount() {
|
||||
return Error.New("number of nodes do not match total count of erasure scheme")
|
||||
return Error.New("number of nodes (%d) do not match total count (%d) of erasure scheme",
|
||||
len(nodes), rs.TotalCount())
|
||||
}
|
||||
if !unique(nodes) {
|
||||
return Error.New("duplicated nodes are not allowed")
|
||||
|
@ -124,8 +124,8 @@ TestLoop:
|
||||
errs []error
|
||||
errString string
|
||||
}{
|
||||
{[]*proto.Node{}, 0, 0, true, []error{}, "ecclient error: " +
|
||||
"number of nodes do not match total count of erasure scheme"},
|
||||
{[]*proto.Node{}, 0, 0, true, []error{},
|
||||
fmt.Sprintf("ecclient error: number of nodes (0) do not match total count (%d) of erasure scheme", n)},
|
||||
{[]*proto.Node{node0, node1, node2, node3}, 0, -1, true,
|
||||
[]error{nil, nil, nil, nil},
|
||||
"eestream error: negative max buffer memory"},
|
||||
|
Loading…
Reference in New Issue
Block a user