Skip to content

Commit

Permalink
version: Clarify origin of error (#953)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
eseliger authored Mar 10, 2023
1 parent 85115b1 commit 42706ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/src/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"io"
"net/http"

"github.com/sourcegraph/sourcegraph/lib/errors"

"github.com/sourcegraph/src-cli/internal/api"
"github.com/sourcegraph/src-cli/internal/version"
)
Expand Down Expand Up @@ -37,7 +39,7 @@ Examples:
client := cfg.apiClient(apiFlags, flagSet.Output())
recommendedVersion, err := getRecommendedVersion(context.Background(), client)
if err != nil {
return err
return errors.Wrap(err, "failed to get recommended version for Sourcegraph deployment")
}
if recommendedVersion == "" {
fmt.Println("Recommended version: <unknown>")
Expand Down

0 comments on commit 42706ee

Please sign in to comment.