Skip to content

Commit

Permalink
sync: improve error message when package can not be gotten (e.g. due …
Browse files Browse the repository at this point in the history
…to a move)
  • Loading branch information
robfig committed Jun 10, 2015
1 parent e0f2599 commit cb3c3ec
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,21 @@ func syncPkg(ch chan<- string, importPath, expectedRevision string) {
if err != nil {
// go get it in case it doesn't exist. (no-op if it does exist)
// (ignore failures due to "no buildable files" or build errors in the package.)
getOutput, _ = run("go", "get", "-v", "-d", importPath)
var getErr error
getOutput, getErr = run("go", "get", "-v", "-d", importPath)
repo, err = fastRepoRoot(importPath)
if err != nil {
perror(err)
var getStatus = "(success)"
if getErr != nil {
getStatus = string(getOutput) + getErr.Error()
}
perror(fmt.Errorf(`failed to get: %s
> go get -v -d %s
%s
> import %s
%s`, importPath, importPath, getStatus, importPath, err))
}
}

Expand Down

0 comments on commit cb3c3ec

Please sign in to comment.