Skip to content

Commit 42706ee

Browse files
authored
version: Clarify origin of error (#953)
This could be confusing, it only says server error and prints details on that, so it sounds like src-cli just broke? At least it confused people at Sourcegraph. This prefixes it with some more context to help that.
1 parent 85115b1 commit 42706ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/src/version.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
"io"
99
"net/http"
1010

11+
"github.com/sourcegraph/sourcegraph/lib/errors"
12+
1113
"github.com/sourcegraph/src-cli/internal/api"
1214
"github.com/sourcegraph/src-cli/internal/version"
1315
)
@@ -37,7 +39,7 @@ Examples:
3739
client := cfg.apiClient(apiFlags, flagSet.Output())
3840
recommendedVersion, err := getRecommendedVersion(context.Background(), client)
3941
if err != nil {
40-
return err
42+
return errors.Wrap(err, "failed to get recommended version for Sourcegraph deployment")
4143
}
4244
if recommendedVersion == "" {
4345
fmt.Println("Recommended version: <unknown>")

0 commit comments

Comments
 (0)