Detect 'errorReason' in error messages from iCloud API
This commit is contained in:
parent
7d57f06bb1
commit
ced8e83a40
1 changed files with 3 additions and 1 deletions
|
@ -79,7 +79,9 @@ class PyiCloudSession(requests.Session):
|
||||||
|
|
||||||
logger.debug(json)
|
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):
|
if not reason and isinstance(json.get('error'), six.string_types):
|
||||||
reason = json.get('error')
|
reason = json.get('error')
|
||||||
if not reason and not response.ok:
|
if not reason and not response.ok:
|
||||||
|
|
Loading…
Reference in a new issue