From 7b1428a498cec89d100dfcc103e256449a5cdf36 Mon Sep 17 00:00:00 2001 From: ctrl-q <34975747+ctrl-q@users.noreply.github.com> Date: Sat, 5 Mar 2022 11:09:37 -0500 Subject: [PATCH] onedrive: Do not retry on 400 pathIsTooLong --- backend/onedrive/onedrive.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index 8052b33a1..3fc06b54b 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -649,6 +649,12 @@ func shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, err retry := false if resp != nil { switch resp.StatusCode { + case 400: + if apiErr, ok := err.(*api.Error); ok { + if apiErr.ErrorInfo.InnerError.Code == "pathIsTooLong" { + return false, fserrors.NoRetryError(err) + } + } case 401: if len(resp.Header["Www-Authenticate"]) == 1 && strings.Index(resp.Header["Www-Authenticate"][0], "expired_token") >= 0 { retry = true