Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit d853066

Browse files
committed
Return error directly in internal/sync/sync.go#Version
1 parent 21976c6 commit d853066

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cmd/coder/sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func (cmd *syncCmd) Run(fl *pflag.FlagSet) {
9999
if rsyncErr != nil {
100100
flog.Info("Unable to determine remote rsync version. Proceeding cautiously.")
101101
} else if localVersion != remoteVersion {
102-
flog.Fatal(fmt.Sprintf("rsync protocol mismatch. local is %s; remote is %s.", localVersion, remoteVersion))
102+
flog.Fatal(fmt.Sprintf("rsync protocol mismatch. %s.", localVersion, rsyncErr))
103103
}
104104

105105
for err == nil || err == sync.ErrRestartSync {

internal/sync/sync.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,11 @@ func (s Sync) Version() (string, error) {
287287
io.Copy(buf, process.Stdout())
288288

289289
err = process.Wait()
290-
if code, ok := err.(wsep.ExitError); ok {
291-
return "", fmt.Errorf("Version check exit status: %v", code)
290+
if _, ok := err.(wsep.ExitError); ok {
291+
return "", err
292292
}
293293
if err != nil {
294-
return "", fmt.Errorf("Server version mismatch")
294+
return "", err
295295
}
296296

297297
firstLine, err := buf.ReadString('\n')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy