Skip to content

Commit e693fb4

Browse files
rscgopherbot
authored andcommitted
go/internal/gcimporter: fix IImportBundle error text
When called from IImportBundle, the current code returns a message saying: cannot import "" (actual error) ... That looks like the user has somehow caused an invalid import path to be passed, which is not the case. Skip the wrapping in the bundle case. Change-Id: I6cdb83911d18501895671fc70d87c2519f0570a3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/310514 Trust: Russ Cox <[email protected]> Run-TryBot: Russ Cox <[email protected]> Reviewed-by: Austin Clements <[email protected]> Auto-Submit: Russ Cox <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent ed5a15c commit e693fb4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

go/internal/gcimporter/iimport.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ func iimportCommon(fset *token.FileSet, imports map[string]*types.Package, data
100100
if !debug {
101101
defer func() {
102102
if e := recover(); e != nil {
103-
if version > currentVersion {
103+
if bundle {
104+
err = fmt.Errorf("%v", e)
105+
} else if version > currentVersion {
104106
err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e)
105107
} else {
106108
err = fmt.Errorf("cannot import %q (%v), possibly version skew - reinstall package", path, e)

0 commit comments

Comments
 (0)