accounts: handle OfflineImapError severity FOLDER

Throw an OfflineImapError when SELECTing a folder is unsuccessful and
bail out with a FOLDER serverity. In accounts.py catch all
OfflineImapErrors and either just log the error and skip the folder or
bubble it up if it's severe.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Sebastian Spaeth
2011-05-07 18:39:13 +02:00
committed by Nicolas Sebrecht
parent dd82f213f0
commit b3a383d151
3 changed files with 22 additions and 3 deletions

View File

@ -393,6 +393,13 @@ def syncfolder(accountname, remoterepos, remotefolder, localrepos,
localrepos.restore_atime()
except (KeyboardInterrupt, SystemExit):
raise
except OfflineImapError, e:
# bubble up severe Errors, skip folder otherwise
if e.severity > OfflineImapError.ERROR.FOLDER:
raise
else:
ui.warn("Aborting folder sync '%s' [acc: '%s']\nReason was: %s" %\
(localfolder.name, accountname, e.reason))
except:
ui.warn("ERROR in syncfolder for %s folder %s: %s" % \
(accountname,remotefolder.getvisiblename(),