Convert errors tracer into a separate package (#5221)

This commit is contained in:
Harshavardhana
2017-11-25 11:58:29 -08:00
committed by GitHub
parent 6e6aeb6a9e
commit 8efa82126b
82 changed files with 1117 additions and 896 deletions

View File

@@ -19,6 +19,8 @@ package cmd
import (
"sort"
"strings"
"github.com/minio/minio/pkg/errors"
)
// Tree walk result carries results of tree walking.
@@ -141,7 +143,7 @@ func doTreeWalk(bucket, prefixDir, entryPrefixMatch, marker string, recursive bo
if err != nil {
select {
case <-endWalkCh:
return traceError(errWalkAbort)
return errors.Trace(errWalkAbort)
case resultCh <- treeWalkResult{err: err}:
return err
}
@@ -203,7 +205,7 @@ func doTreeWalk(bucket, prefixDir, entryPrefixMatch, marker string, recursive bo
isEOF := ((i == len(entries)-1) && isEnd)
select {
case <-endWalkCh:
return traceError(errWalkAbort)
return errors.Trace(errWalkAbort)
case resultCh <- treeWalkResult{entry: pathJoin(prefixDir, entry), end: isEOF}:
}
}