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:
		| @@ -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"'% | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Nicolas Sebrecht
					Nicolas Sebrecht