From 13c432caf0e8871c02fab509651d1d768288d6cc Mon Sep 17 00:00:00 2001 From: Brian Stinson Date: Jul 05 2014 22:14:59 +0000 Subject: Catch exceptions when running commands for a nicer experience when things go wrong --- diff --git a/src/centpkg/__main__.py b/src/centpkg/__main__.py index cac69d2..8b1bb76 100644 --- a/src/centpkg/__main__.py +++ b/src/centpkg/__main__.py @@ -67,6 +67,9 @@ def main(): sys.exit(client.args.command()) except KeyboardInterrupt: pass + except Exception, e: + log.error('Could not execute %s: %s' % (client.args.command.__name__, e)) + sys.exit(1) if __name__ == '__main__': main()