dropbox: make error insufficient space to be fatal

This commit is contained in:
harry 2020-03-26 14:15:35 +05:30 committed by Nick Craig-Wood
parent 7d9ca3998e
commit d91a547d59

6
backend/dropbox/dropbox.go Normal file → Executable file
View file

@ -225,7 +225,11 @@ func shouldRetry(err error) (bool, error) {
return false, err return false, err
} }
baseErrString := errors.Cause(err).Error() baseErrString := errors.Cause(err).Error()
// handle any official Retry-After header from Dropbox's SDK first // First check for Insufficient Space
if strings.Contains(baseErrString, "insufficient_space") {
return false, fserrors.FatalError(err)
}
// Then handle any official Retry-After header from Dropbox's SDK
switch e := err.(type) { switch e := err.(type) {
case auth.RateLimitAPIError: case auth.RateLimitAPIError:
if e.RateLimitError.RetryAfter > 0 { if e.RateLimitError.RetryAfter > 0 {