diff options
-rw-r--r-- | climl/__init__.py | 6 | ||||
-rw-r--r-- | climl/imap.py | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/climl/__init__.py b/climl/__init__.py index 8924ebf..b4ccecf 100644 --- a/climl/__init__.py +++ b/climl/__init__.py @@ -18,10 +18,10 @@ def on_email(content, hooks, conf): print('on_email, calling hook {}'.format(hook.__name__)) hook(context) print('on_email, end of hook {}'.format(hook.__name__)) - except interface.HookStopIteration: - pass + except interface.HookStopIteration as e: + print('hook wanted to stop processing for current email', e) print('now, raising exception (for dev purpose only)') - raise interface.HookAbortError() + raise interface.HookAbortError('dev purpose abort') def conf_boolean_postprocess(src): diff --git a/climl/imap.py b/climl/imap.py index 7743712..5c66833 100644 --- a/climl/imap.py +++ b/climl/imap.py @@ -125,8 +125,9 @@ def process_emails(connection, callback=None, maxsize=None): callback(data) print('mark mail {}'.format(oneid)) connection.add_flags([oneid], ['\Answered']) - except interface.HookAbortError: + except interface.HookAbortError as e: print('callback wanted to skip marking of mail {}'.format(oneid)) + print('reason', e) data = None |