Skip to content

Commit

Permalink
added NineMLUsageError to list of pretty printed errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Dec 3, 2017
1 parent 84d5b0d commit f4c1a6c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/pype9
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ from copy import copy
from argparse import ArgumentParser
import pype9.cmd
from pype9.utils.logging import logger
from pype9.exceptions import Pype9RuntimeError
from nineml.exceptions import NineMLUsageError

parser = ArgumentParser(__doc__)
parser.add_argument('cmd', choices=pype9.cmd.help.all_cmds(),
Expand All @@ -26,7 +28,7 @@ argv = copy(sys.argv[2:])
del sys.argv[1:]
try:
getattr(pype9.cmd, args.cmd).run(argv)
except Pype9UsageError as e:
except (NineMLUsageError, Pype9RuntimeError) as e:
logger.error(e)
sys.exit(1) # Signal an error to the calling shell

0 comments on commit f4c1a6c

Please sign in to comment.