Catch exceptions when running commands for a nicer experience when things go wrong

This commit is contained in:
Brian Stinson 2014-07-05 17:14:59 -05:00 committed by Johnny Hughes
parent b7b95ab85d
commit 13c432caf0

View file

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