[CentOS-devel] [PATCH 1/3] Catch exceptions when running commands for a nicer experience when things go wrong

Sat Jul 5 21:56:08 UTC 2014
Brian Stinson <bstinson at ksu.edu>

---
 src/centpkg/__main__.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

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()
-- 
1.7.1