Skip to content

Commit 68b1197

Browse files
committed
better logging for fetch not working
1 parent 89a66cd commit 68b1197

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: cmd/root.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,14 @@ func compose(commands ...func(cmd *cobra.Command, args []string)) func(cmd *cobr
9595
// if you want to require the user to update their CLI first.
9696
func requireUpdated(cmd *cobra.Command, args []string) {
9797
info := version.FromContext(cmd.Context())
98-
if info == nil || info.FailedToFetch != nil {
98+
if info == nil {
9999
fmt.Fprintln(os.Stderr, "Failed to fetch update info. Are you online?")
100100
os.Exit(1)
101101
}
102+
if info.FailedToFetch != nil {
103+
fmt.Fprintf(os.Stderr, "Failed to fetch update info: %s\n", info.FailedToFetch.Error())
104+
os.Exit(1)
105+
}
102106
if info.IsUpdateRequired {
103107
info.PromptUpdateIfAvailable()
104108
os.Exit(1)

Diff for: version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.10.1
1+
v1.10.2

0 commit comments

Comments
 (0)