Skip to content

Commit

Permalink
log the error instead of printing it
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Dec 1, 2017
1 parent 2d8a69b commit 84d5b0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/pype9
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import sys
from copy import copy
from argparse import ArgumentParser
import pype9.cmd
from pype9.utils.logging import logger

parser = ArgumentParser(__doc__)
parser.add_argument('cmd', choices=pype9.cmd.help.all_cmds(),
Expand All @@ -26,6 +27,6 @@ del sys.argv[1:]
try:
getattr(pype9.cmd, args.cmd).run(argv)
except Pype9UsageError as e:
print(e) # Prettier error messages than the full stack trace
logger.error(e)
sys.exit(1) # Signal an error to the calling shell

0 comments on commit 84d5b0d

Please sign in to comment.