mailpipe: print error messages when we continue_after_invalid_message.
authorW. Trevor King <wking@tremily.us>
Sun, 2 Sep 2012 13:06:17 +0000 (09:06 -0400)
committerW. Trevor King <wking@tremily.us>
Sun, 2 Sep 2012 13:06:17 +0000 (09:06 -0400)
Since we're not raising the message, we should log it.  Otherwise the
user may not know that something is amiss.

pygrader/mailpipe.py

index dd88d824cad37315ee9a062219e3eb6d664c063c..3f3652af2ee27e84b301280210ae8b2dff479a30 100644 (file)
@@ -573,6 +573,7 @@ def mailpipe(basedir, course, stream=None, mailbox=None, input_=None,
             _LOG.warn('invalid message {}'.format(error.message_id()))
             if not continue_after_invalid_message:
                 raise
+            _LOG.warn('{}'.format(error))
             if respond:
                 response = _get_error_response(error)
                 respond(response)
@@ -641,6 +642,7 @@ def _load_messages(course, stream, mailbox=None, input_=None, output=None,
             _LOG.warn('invalid message {}'.format(error.message_id()))
             if not continue_after_invalid_message:
                 raise
+            _LOG.warn('{}'.format(error))
             if respond:
                 response = _get_error_response(error)
                 if response is not None: