From f2d4c668d5fd82ccb65103b8bbbc48ad3deb80ca Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Tue, 16 May 2006 03:34:46 +0100 Subject: [PATCH] return 0 rather than raise exception to indicate that message was saved with unknown UID --- offlineimap/folder/IMAP.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index 45978b5..50dd20b 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -161,11 +161,13 @@ class IMAPFolder(BaseFolder): matchinguids = imapobj.uid('search', 'HEADER', headername, headervalue)[1][0] except imapobj.error, err: # IMAP server doesn't implement search or had a problem. - raise ValueError, "Got IMAP error while attempting to find UID for message with header %s: %s" % (headername, err) + ui.debug('imap', "savemessage_searchforheader: got IMAP error '%s' while attempting to UID SEARCH for message with header %s" % (err, headername) + return 0 ui.debug('imap', 'savemessage_searchforheader got initial matchinguids: ' + repr(matchinguids)) if matchinguids == '': - raise ValueError, "Search for UID for message with header %s yielded no results" % headername + ui.debug('imap', "savemessage_searchforheader: UID SEARCH for message with header %s yielded no results" % headername) + return 0 matchinguids = matchinguids.split(' ') ui.debug('imap', 'savemessage_searchforheader: matchinguids now ' + \