You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by ad...@apache.org on 2014/07/17 07:24:27 UTC
svn commit: r1611250 - /labs/panopticon/pan-commands/bin/moderator
Author: adc
Date: Thu Jul 17 05:24:26 2014
New Revision: 1611250
URL: http://svn.apache.org/r1611250
Log:
Print errors to stderr
Modified:
labs/panopticon/pan-commands/bin/moderator
Modified: labs/panopticon/pan-commands/bin/moderator
URL: http://svn.apache.org/viewvc/labs/panopticon/pan-commands/bin/moderator?rev=1611250&r1=1611249&r2=1611250&view=diff
==============================================================================
--- labs/panopticon/pan-commands/bin/moderator (original)
+++ labs/panopticon/pan-commands/bin/moderator Thu Jul 17 05:24:26 2014
@@ -21,6 +21,7 @@
Mailing list moderator tool used to manage mailing lists from the command line.
"""
import restkit
+import sys
from asf.cli import entrypoint
from asf.data import aliases, lists
@@ -114,8 +115,10 @@ def cmd_members(args):
def main(cli):
cli.add_username_password(use_store=True)
- cli.register_exception(KeyError, lambda e: cli.log.error(e))
- cli.register_exception(restkit.RequestError, lambda e: cli.log.error('Unable to reach %s' % lists.EZMLM_URL))
+ def print_error(error):
+ print >>sys.stderr, '\033[91m' + str(error).replace("'", "") + '\033[0m'
+ cli.register_exception(KeyError, print_error)
+ cli.register_exception(restkit.RequestError, lambda e: print_error('Unable to reach %s' % lists.EZMLM_URL))
parser = cli.argparser
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org