Skip to content

Commit ee4e0c2

Browse files
authored
Merge pull request golang#193 from tomwilkie/improve-error-message
Improve error messages then a VCS operation fails.
2 parents 072e002 + 1d32941 commit ee4e0c2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

maybe_source.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (m maybeGitSource) try(cachedir string, an ProjectAnalyzer) (source, string
6767
path := filepath.Join(cachedir, "sources", sanitizer.Replace(ustr))
6868
r, err := vcs.NewGitRepo(ustr, path)
6969
if err != nil {
70-
return nil, "", err
70+
return nil, ustr, err
7171
}
7272

7373
src := &gitSource{
@@ -85,7 +85,7 @@ func (m maybeGitSource) try(cachedir string, an ProjectAnalyzer) (source, string
8585
if !r.CheckLocal() {
8686
_, err = src.listVersions()
8787
if err != nil {
88-
return nil, "", err
88+
return nil, ustr, err
8989
}
9090
}
9191

@@ -112,7 +112,7 @@ func (m maybeGopkginSource) try(cachedir string, an ProjectAnalyzer) (source, st
112112
ustr := m.url.String()
113113
r, err := vcs.NewGitRepo(ustr, path)
114114
if err != nil {
115-
return nil, "", err
115+
return nil, ustr, err
116116
}
117117

118118
src := &gopkginSource{
@@ -133,7 +133,7 @@ func (m maybeGopkginSource) try(cachedir string, an ProjectAnalyzer) (source, st
133133
if !r.CheckLocal() {
134134
_, err = src.listVersions()
135135
if err != nil {
136-
return nil, "", err
136+
return nil, ustr, err
137137
}
138138
}
139139

@@ -149,10 +149,10 @@ func (m maybeBzrSource) try(cachedir string, an ProjectAnalyzer) (source, string
149149
path := filepath.Join(cachedir, "sources", sanitizer.Replace(ustr))
150150
r, err := vcs.NewBzrRepo(ustr, path)
151151
if err != nil {
152-
return nil, "", err
152+
return nil, ustr, err
153153
}
154154
if !r.Ping() {
155-
return nil, "", fmt.Errorf("Remote repository at %s does not exist, or is inaccessible", ustr)
155+
return nil, ustr, fmt.Errorf("Remote repository at %s does not exist, or is inaccessible", ustr)
156156
}
157157

158158
src := &bzrSource{
@@ -183,10 +183,10 @@ func (m maybeHgSource) try(cachedir string, an ProjectAnalyzer) (source, string,
183183
path := filepath.Join(cachedir, "sources", sanitizer.Replace(ustr))
184184
r, err := vcs.NewHgRepo(ustr, path)
185185
if err != nil {
186-
return nil, "", err
186+
return nil, ustr, err
187187
}
188188
if !r.Ping() {
189-
return nil, "", fmt.Errorf("Remote repository at %s does not exist, or is inaccessible", ustr)
189+
return nil, ustr, fmt.Errorf("Remote repository at %s does not exist, or is inaccessible", ustr)
190190
}
191191

192192
src := &hgSource{

0 commit comments

Comments
 (0)