Remove error package and cause functions (#5784)

This commit is contained in:
kannappanr
2018-04-10 09:36:37 -07:00
committed by GitHub
parent 217fb470a7
commit cef992a395
51 changed files with 186 additions and 519 deletions
+4 -5
View File
@@ -26,7 +26,6 @@ import (
"testing"
humanize "github.com/dustin/go-humanize"
"github.com/minio/minio/pkg/errors"
)
// Tests caclculating disk count.
@@ -93,11 +92,11 @@ func TestReduceErrs(t *testing.T) {
// Validates list of all the testcases for returning valid errors.
for i, testCase := range testCases {
gotErr := reduceReadQuorumErrs(context.Background(), testCase.errs, testCase.ignoredErrs, 5)
if errors.Cause(gotErr) != testCase.err {
if gotErr != testCase.err {
t.Errorf("Test %d : expected %s, got %s", i+1, testCase.err, gotErr)
}
gotNewErr := reduceWriteQuorumErrs(context.Background(), testCase.errs, testCase.ignoredErrs, 6)
if errors.Cause(gotNewErr) != errXLWriteQuorum {
if gotNewErr != errXLWriteQuorum {
t.Errorf("Test %d : expected %s, got %s", i+1, errXLWriteQuorum, gotErr)
}
}
@@ -388,8 +387,8 @@ func TestGetPartSizeFromIdx(t *testing.T) {
if err == nil {
t.Errorf("Test %d: Expected to failed but passed. %s", i+1, err)
}
if err != nil && errors.Cause(err) != testCaseFailure.err {
t.Errorf("Test %d: Expected err %s, but got %s", i+1, testCaseFailure.err, errors.Cause(err))
if err != nil && err != testCaseFailure.err {
t.Errorf("Test %d: Expected err %s, but got %s", i+1, testCaseFailure.err, err)
}
}
}