accounting: Correct exitcode on Transfer Limit Exceeded flag. Fixes #3203
Before this change the exit code for transfer limit exceeded was incorrect. This was because the `resolveExitCode` function unwraps the error thus reading the underlying error which is not the same as the error it was comparing to (`ErrorMaxTransferLimitReached`). This change fixes it by splitting the error definition in two so that when the Fatal error is unwrapped we match against `ErrorMaxTransferLimitReached` however when we return the error we return `ErrorMaxTransferLimitReachedFatal`.
This commit is contained in:
parent
132ce94139
commit
f14871caf7
4 changed files with 10 additions and 6 deletions
|
@ -1811,7 +1811,7 @@ func TestAbort(t *testing.T) {
|
|||
accounting.GlobalStats().ResetCounters()
|
||||
|
||||
err := Sync(context.Background(), r.Fremote, r.Flocal, false)
|
||||
expectedErr := fserrors.FsError(accounting.ErrorMaxTransferLimitReached)
|
||||
expectedErr := fserrors.FsError(accounting.ErrorMaxTransferLimitReachedFatal)
|
||||
fserrors.Count(expectedErr)
|
||||
assert.Equal(t, expectedErr, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue