From ced8e83a40764438b9f0de7f441b932411aaac97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 10 Oct 2016 01:18:49 +0200 Subject: [PATCH] Detect 'errorReason' in error messages from iCloud API --- pyicloud/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyicloud/base.py b/pyicloud/base.py index bed32d6..e05fc30 100644 --- a/pyicloud/base.py +++ b/pyicloud/base.py @@ -79,7 +79,9 @@ class PyiCloudSession(requests.Session): logger.debug(json) - reason = json.get('errorMessage') or json.get('reason') + reason = json.get('errorMessage') + reason = reason or json.get('reason') + reason = reason or json.get('errorReason') if not reason and isinstance(json.get('error'), six.string_types): reason = json.get('error') if not reason and not response.ok: