[PATCH 1/3] Catch correct type of exception

Vladimir Marek Vladimir.Marek at Oracle.COM
Wed Aug 17 09:11:04 BST 2011


> diff --git a/offlineimap/folder/Base.py b/offlineimap/folder/Base.py
> index 3da0de1..7f510e0 100644
> --- a/offlineimap/folder/Base.py
> +++ b/offlineimap/folder/Base.py
> @@ -428,7 +428,7 @@ class BaseFolder(object):
>                  action(dstfolder, statusfolder)
>              except (KeyboardInterrupt):
>                  raise
> -            except OfflineImap, e:
> +            except OfflineImapError, e:
>                  if e.severity > OfflineImapError.ERROR.FOLDER:
>                      raise
>                  self.ui.error(e, exc_info()[2])

There is still something broken about catching exceptions. If the
severity is > than FOLDER, but I haven't investigated why. If you throw
OfflineImapError > FOLDER, it does not seem to be caught at all. It
seems that this function should do it:

offlineimap/threadutil.py:
class ExitNotifyThread(Thread):
  def run(self):
    ...

but nothing is displayed anywhere. Someone with better python knowledge
might be better at tracking this down (wink wink) :)
-- 
	Vlad




More information about the OfflineIMAP-project mailing list