folder: IMAP: change raw assert to OfflineImapError
There is not reason to block remainings actions on first error on UID STORE. Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
c7434ea46c
commit
cbd1a8929a
@ -1092,9 +1092,10 @@ class BaseFolder(object):
|
|||||||
except OfflineImapError as e:
|
except OfflineImapError as e:
|
||||||
if e.severity > OfflineImapError.ERROR.FOLDER:
|
if e.severity > OfflineImapError.ERROR.FOLDER:
|
||||||
raise
|
raise
|
||||||
self.ui.error(e, exc_info()[2])
|
self.ui.error(e, exc_info()[2], "while syncing %s [account %s]"%
|
||||||
|
(self, self.accountname))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.ui.error(e, exc_info()[2], "Syncing folder %s [acc: %s]"%
|
self.ui.error(e, exc_info()[2], "while syncing %s [account %s]"%
|
||||||
(self, self.accountname))
|
(self, self.accountname))
|
||||||
raise # Raise unknown Exceptions so we can fix them.
|
raise # Raise unknown Exceptions so we can fix them.
|
||||||
|
|
||||||
|
@ -832,19 +832,22 @@ class IMAPFolder(BaseFolder):
|
|||||||
except imapobj.readonly:
|
except imapobj.readonly:
|
||||||
self.ui.flagstoreadonly(self, uidlist, flags)
|
self.ui.flagstoreadonly(self, uidlist, flags)
|
||||||
return
|
return
|
||||||
r = imapobj.uid('store',
|
response = imapobj.uid('store',
|
||||||
imaputil.uid_sequence(uidlist), operation + 'FLAGS',
|
imaputil.uid_sequence(uidlist), operation + 'FLAGS',
|
||||||
imaputil.flagsmaildir2imap(flags))
|
imaputil.flagsmaildir2imap(flags))
|
||||||
assert r[0] == 'OK', 'Error with store: ' + '. '.join(r[1])
|
if response[0] != 'OK':
|
||||||
r = r[1]
|
raise OfflineImapError(
|
||||||
|
'Error with store: %s'% '. '.join(response[1]),
|
||||||
|
OfflineImapError.ERROR.MESSAGE)
|
||||||
|
response = response[1]
|
||||||
finally:
|
finally:
|
||||||
self.imapserver.releaseconnection(imapobj)
|
self.imapserver.releaseconnection(imapobj)
|
||||||
# Some IMAP servers do not always return a result. Therefore,
|
# Some IMAP servers do not always return a result. Therefore,
|
||||||
# only update the ones that it talks about, and manually fix
|
# only update the ones that it talks about, and manually fix
|
||||||
# the others.
|
# the others.
|
||||||
needupdate = list(uidlist)
|
needupdate = list(uidlist)
|
||||||
for result in r:
|
for result in response:
|
||||||
if result == None:
|
if result is None:
|
||||||
# Compensate for servers that don't return anything from
|
# Compensate for servers that don't return anything from
|
||||||
# STORE.
|
# STORE.
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user