2nd stage of better error reporting

Sebastian Spaeth Sebastian at SSpaeth.de
Tue Jun 14 09:22:43 BST 2011


The introduction of OfflineImapError at different severity levels
allowed us to throw errors that can be used to only skip messages, or
folders and continue with the rest. However, our logging still sucked,
just outputting a notice in the log which could easily be overlooked.

This patch series implements a UI.error() function that takes an
Exception (and possibly a prepending explaining message) and:

1) Outputs the Exception string to the error log whenever it occurs.
2) Stores all occurring exceptions in a Queue.
3) At program exits, outputs all Exceptions again.

This allows a user to easily see which messages and folders (or
accounts) have been skipped, so that she can take action to fix whatever
went wrong.

If (and only if) we are in debug mode, we will also output the traceback
of the exception that has occurred. This should do away with what looked
ugly "as a crash" to users, but still let's us collect tracebacks when
we need them for debugging.

The patches:
0001-Don-t-use-CStringIO-to-format-a-traceback.patch
      Unrelated cleanup patch in the traceback formatting that should be
      applied in any case.
0002-Implement-ui.error-and-output-them-at-end-of-offlini.patch
      The main patch, implementing the infrastructure for ui.error() and
      doing the logging.
0003-accounts.py-Use-ui.error-when-raising-exceptions.patch
      Converts accounts.py to use the new ui.error() infrastructure
      whenever possible.
0004-folder-Base-Convert-exceptions-to-self.ui.error.patch
      Converts folder/Base to use the new ui.error() infrastructure
      whenever possible.

There are still a few other places left that can make use of the new
infrastructure, but I wanted to get this one in first, before I waste
efforts in case this gets rejected.

Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20110614/7ff39416/attachment.sig>


More information about the OfflineIMAP-project mailing list