mirror of
https://git.centos.org/centos/centpkg.git
synced 2025-02-23 16:22:55 +00:00
Catch exceptions when running commands for a nicer experience when things go wrong
This commit is contained in:
parent
b7b95ab85d
commit
13c432caf0
1 changed files with 3 additions and 0 deletions
|
@ -67,6 +67,9 @@ def main():
|
||||||
sys.exit(client.args.command())
|
sys.exit(client.args.command())
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
|
except Exception, e:
|
||||||
|
log.error('Could not execute %s: %s' % (client.args.command.__name__, e))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Add table
Reference in a new issue