Cleanup and consolidate error handling

This commit is contained in:
Todd Gamblin
2015-06-06 15:50:01 -07:00
parent b9746de52e
commit 53feb12ea0
4 changed files with 21 additions and 18 deletions

View File

@@ -126,14 +126,7 @@ def main():
try:
return_val = command(parser, args)
except SpackError, e:
if spack.debug:
# In debug mode, raise with a full stack trace.
raise
elif e.long_message:
tty.die(e.message, e.long_message)
else:
tty.die(e.message)
e.die()
except KeyboardInterrupt:
sys.stderr.write('\n')
tty.die("Keyboard interrupt.")