Use fmt.Errorf when appropriate.

This commit is contained in:
Caleb Spare 2013-07-02 14:47:58 -07:00
parent dd1b9e38e9
commit e93afcdd2b
1 changed files with 1 additions and 2 deletions

View File

@ -4,7 +4,6 @@ import (
"archive/tar"
"bufio"
"bytes"
"errors"
"fmt"
"github.com/dotcloud/docker/utils"
"io"
@ -251,7 +250,7 @@ func CmdStream(cmd *exec.Cmd) (io.Reader, error) {
}
errText := <-errChan
if err := cmd.Wait(); err != nil {
pipeW.CloseWithError(errors.New(err.Error() + ": " + string(errText)))
pipeW.CloseWithError(fmt.Errorf("%s: %s", err, errText))
} else {
pipeW.Close()
}