Skip to content

Commit de4c073

Browse files
author
Bryan C. Mills
committed
cmd/go/internal/modfetch: report the module path for errors in (*codeRepo).Versions
Updates #34094 Change-Id: Ifd10b51c2b4ebe77c4f8f68726e411f54c13b9c9 Reviewed-on: https://go-review.googlesource.com/c/go/+/194560 Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
1 parent 5bb19e3 commit de4c073

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/cmd/go/internal/modfetch/coderepo.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ func (r *codeRepo) Versions(prefix string) ([]string, error) {
140140
}
141141
tags, err := r.code.Tags(p)
142142
if err != nil {
143-
return nil, err
143+
return nil, &module.ModuleError{
144+
Path: r.modPath,
145+
Err: err,
146+
}
144147
}
145148

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

0 commit comments

Comments
 (0)