+ try:
+ module.main()
+ except KeyboardInterrupt:
+ msg = 'KeyboardInterrupt caught; exiting'
+ print msg
+ if logger:
+ logger.log([msg])
+ sys.exit(1)
+ except SystemExit:
+ pass
+ except:
+ if logger:
+ for line in traceback.format_exc().split('\n')[:-1]:
+ logger.log(['exception', line])
+ raise