XOAUTH2: raise error if string 'error' is in the response
Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/374 Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
59d254c783
commit
38c6785636
@ -264,6 +264,9 @@ class IMAPServer(object):
|
||||
|
||||
resp = json.loads(response)
|
||||
self.ui.debug('imap', 'xoauth2handler: response "%s"'% resp)
|
||||
if u'error' in resp:
|
||||
raise OfflineImapError("xoauth2handler got: %s"% resp,
|
||||
OfflineImapError.ERROR.REPO)
|
||||
self.oauth2_access_token = resp['access_token']
|
||||
|
||||
self.ui.debug('imap', 'xoauth2handler: access_token "%s"'%
|
||||
|
Loading…
Reference in New Issue
Block a user