diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2013-10-07 17:57:27 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2013-10-07 17:57:27 -0700 |
commit | 618571b807f32bd3ebbd1c2c5351fbac7cab2f76 (patch) | |
tree | e2f1c784901c0e7b5e5a4a6bacdc3fe553f6d998 /bin | |
parent | 157737efbe54a396cf147ed661f43d566e1715fd (diff) | |
download | spack-618571b807f32bd3ebbd1c2c5351fbac7cab2f76.tar.gz spack-618571b807f32bd3ebbd1c2c5351fbac7cab2f76.tar.bz2 spack-618571b807f32bd3ebbd1c2c5351fbac7cab2f76.tar.xz spack-618571b807f32bd3ebbd1c2c5351fbac7cab2f76.zip |
Checkpoint commit: much-improved spec class.
Still organizing things.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/spack | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -19,6 +19,7 @@ sys.path.insert(0, SPACK_LIB_PATH) del SPACK_FILE, SPACK_PREFIX, SPACK_LIB_PATH import spack import spack.tty as tty +from spack.error import SpackError # Command parsing parser = argparse.ArgumentParser( @@ -50,5 +51,12 @@ spack.debug = args.debug command = spack.cmd.get_command(args.command) try: command(parser, args) +except SpackError, e: + if spack.debug: + # In debug mode, raise with a full stack trace. + raise + else: + # Otherwise print a nice simple message. + tty.die(e.message) except KeyboardInterrupt: tty.die("Got a keyboard interrupt from the user.") |