1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

cmd: make exit code 8 for --max-transfer exceeded

This commit is contained in:
Nick Craig-Wood
2018-05-03 15:04:30 +01:00
parent f95835d613
commit 21383877df
2 changed files with 10 additions and 4 deletions

View File

@@ -62,6 +62,7 @@ const (
exitCodeRetryError
exitCodeNoRetryError
exitCodeFatalError
exitCodeTransferExceeded
)
// Root is the main rclone command
@@ -461,15 +462,17 @@ func resolveExitCode(err error) {
os.Exit(exitCodeSuccess)
}
err = errors.Cause(err)
_, unwrapped := fserrors.Cause(err)
switch {
case err == fs.ErrorDirNotFound:
case unwrapped == fs.ErrorDirNotFound:
os.Exit(exitCodeDirNotFound)
case err == fs.ErrorObjectNotFound:
case unwrapped == fs.ErrorObjectNotFound:
os.Exit(exitCodeFileNotFound)
case err == errorUncategorized:
case unwrapped == errorUncategorized:
os.Exit(exitCodeUncategorizedError)
case unwrapped == accounting.ErrorMaxTransferLimitReached:
os.Exit(exitCodeTransferExceeded)
case fserrors.ShouldRetry(err):
os.Exit(exitCodeRetryError)
case fserrors.IsNoRetryError(err):