1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-16 00:04:40 +00:00

onedrive: handle HTTP 400 better in PublicLink() (#5419)

This commit is contained in:
Alex Chen
2021-07-27 17:55:57 +08:00
committed by Nick Craig-Wood
parent 3ba001f8d7
commit 34f89043af
2 changed files with 12 additions and 1 deletions

View File

@@ -1500,7 +1500,9 @@ func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration,
return shouldRetry(ctx, resp, err)
})
if err != nil {
fmt.Println(err)
if resp != nil && resp.StatusCode == 400 && f.driveType != driveTypePersonal {
return "", errors.Errorf("%v (is making public links permitted by the org admin?)", err)
}
return "", err
}