diff --git a/pyicloud/base.py b/pyicloud/base.py index 87fa533..da1246a 100644 --- a/pyicloud/base.py +++ b/pyicloud/base.py @@ -114,7 +114,7 @@ class PyiCloudSession(requests.Session): def _raise_error(self, code, reason): if self.service.requires_2sa and \ reason == 'Missing X-APPLE-WEBAUTH-TOKEN cookie': - raise PyiCloud2SARequiredError(response.url) + raise PyiCloud2SARequiredError(self.service.user['apple_id']) if code == 'ZONE_NOT_FOUND' or code == 'AUTHENTICATION_FAILED': reason = 'Please log into https://icloud.com/ to manually ' \ 'finish setting up your iCloud service' diff --git a/pyicloud/exceptions.py b/pyicloud/exceptions.py index f3cadea..8a65a54 100644 --- a/pyicloud/exceptions.py +++ b/pyicloud/exceptions.py @@ -25,8 +25,8 @@ class PyiCloudFailedLoginException(PyiCloudException): class PyiCloud2SARequiredError(PyiCloudException): - def __init__(self, url): - message = "Two-step authentication required for %s" % url + def __init__(self, apple_id): + message = "Two-step authentication required for account: %s" % apple_id super(PyiCloud2SARequiredError, self).__init__(message)