- Notifications
You must be signed in to change notification settings - Fork18
Rsync error msgs#58
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2,6 +2,7 @@ package main | ||
import ( | ||
"errors" | ||
"fmt" | ||
"os" | ||
"path/filepath" | ||
"strings" | ||
@@ -31,7 +32,8 @@ func (cmd *syncCmd) RegisterFlags(fl *pflag.FlagSet) { | ||
} | ||
// See https://lxadm.com/Rsync_exit_codes#List_of_standard_rsync_exit_codes. | ||
var IncompatRsync = errors.New("rsync: exit status 2") | ||
var StreamErrRsync = errors.New("rsync: exit status 12") | ||
func (cmd *syncCmd) Run(fl *pflag.FlagSet) { | ||
var ( | ||
@@ -79,8 +81,10 @@ func (cmd *syncCmd) Run(fl *pflag.FlagSet) { | ||
err = s.Run() | ||
} | ||
iffmt.Sprintf("%v",err) ==fmt.Sprintf("%v", IncompatRsync) { | ||
flog.Fatal("no compatible rsync present on remote machine") | ||
} else if fmt.Sprintf("%v", err) == fmt.Sprintf("%v", StreamErrRsync) { | ||
flog.Fatal("error in rsync protocol datastream (no installed remote rsync?)") | ||
Comment on lines +84 to +87 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This isn't great. We should be checking the exit codehere, and wrap the error with an informative string based on the exit code. Seehttps://stackoverflow.com/a/55055100 for how we can get the exit code from a command error. Author
| ||
} else { | ||
flog.Fatal("sync: %v", err) | ||
} | ||