Skip to content

Commit

Permalink
cmd/go/internal/modfetch: report the module path for errors in (*code…
Browse files Browse the repository at this point in the history
…Repo).Versions

Updates #34094

Change-Id: Ifd10b51c2b4ebe77c4f8f68726e411f54c13b9c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/194560
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
  • Loading branch information
Bryan C. Mills committed Sep 10, 2019
1 parent 5bb19e3 commit de4c073
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/cmd/go/internal/modfetch/coderepo.go
Expand Up @@ -140,7 +140,10 @@ func (r *codeRepo) Versions(prefix string) ([]string, error) {
}
tags, err := r.code.Tags(p)
if err != nil {
return nil, err
return nil, &module.ModuleError{
Path: r.modPath,
Err: err,
}
}

list := []string{}
Expand Down Expand Up @@ -171,7 +174,10 @@ func (r *codeRepo) Versions(prefix string) ([]string, error) {
// by referring to them with a +incompatible suffix, as in v17.0.0+incompatible.
files, err := r.code.ReadFileRevs(incompatible, "go.mod", codehost.MaxGoMod)
if err != nil {
return nil, err
return nil, &module.ModuleError{
Path: r.modPath,
Err: err,
}
}
for _, rev := range incompatible {
f := files[rev]
Expand Down

0 comments on commit de4c073

Please sign in to comment.