MCPcopy
hub / github.com/tuna/tunasync / TranslateRsyncErrorCode

Function TranslateRsyncErrorCode

internal/util.go:146–156  ·  view source on GitHub ↗

TranslateRsyncErrorCode translates the exit code of rsync to a message

(cmdErr error)

Source from the content-addressed store, hash-verified

144
145// TranslateRsyncErrorCode translates the exit code of rsync to a message
146func TranslateRsyncErrorCode(cmdErr error) (exitCode int, msg string) {
147
148 if exiterr, ok := cmdErr.(*exec.ExitError); ok {
149 exitCode = exiterr.ExitCode()
150 strerr, valid := rsyncExitValues[exitCode]
151 if valid {
152 msg = fmt.Sprintf("rsync error: %s", strerr)
153 }
154 }
155 return
156}

Callers 2

RunMethod · 0.92
RunMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected