folder/IMAP: improve handling of "matchinguids" error while searching headers
Raise OfflineImapError instead of ValueError. Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/452 Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
e88a6bcf03
commit
2c6fac6449
@ -392,9 +392,12 @@ class IMAPFolder(BaseFolder):
|
|||||||
self.ui.debug('imap', '__savemessage_searchforheader: matchinguids now '
|
self.ui.debug('imap', '__savemessage_searchforheader: matchinguids now '
|
||||||
+ repr(matchinguids))
|
+ repr(matchinguids))
|
||||||
if len(matchinguids) != 1 or matchinguids[0] is None:
|
if len(matchinguids) != 1 or matchinguids[0] is None:
|
||||||
raise ValueError("While attempting to find UID for message with "
|
raise OfflineImapError(
|
||||||
"header %s, got wrong-sized matchinguids of %s"%
|
"While attempting to find UID for message with "
|
||||||
(headername, str(matchinguids)))
|
"header %s, got wrong-sized matchinguids of %s"%
|
||||||
|
(headername, str(matchinguids)),
|
||||||
|
OfflineImapError.ERROR.MESSAGE
|
||||||
|
)
|
||||||
return int(matchinguids[0])
|
return int(matchinguids[0])
|
||||||
|
|
||||||
def __savemessage_fetchheaders(self, imapobj, headername, headervalue):
|
def __savemessage_fetchheaders(self, imapobj, headername, headervalue):
|
||||||
|
Loading…
Reference in New Issue
Block a user