From 8e55d638f16d819daee0d7cc4c9e558285d4bc28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccolo=CC=80=20Zapponi?= Date: Tue, 10 Nov 2020 19:42:46 +0000 Subject: [PATCH] Added retry for error codes 421 and 500 --- pyicloud/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyicloud/base.py b/pyicloud/base.py index d7b8070..e6977ae 100644 --- a/pyicloud/base.py +++ b/pyicloud/base.py @@ -102,7 +102,7 @@ class PyiCloudSession(Session): LOGGER.debug("Cookies saved to %s", self.service.cookiejar_path) if not response.ok and content_type not in json_mimetypes: - if has_retried is None and response.status_code == 450: + if has_retried is None and response.status_code in [421, 450, 500]: api_error = PyiCloudAPIResponseException( response.reason, response.status_code, retry=True )