1. Rename CommandError -> InstallError

2. InstallError now subclasses SpackError vs. StandardError (so it is now
handled by the spack shell script)
This commit is contained in:
Peter Scheibel 2015-10-23 16:18:06 -07:00
parent ea872f8098
commit d76c923623
2 changed files with 7 additions and 5 deletions

View File

@ -36,6 +36,7 @@
import spack
import spack.compilers as compilers
from spack.error import SpackError
from spack.util.executable import Executable, which
from spack.util.environment import *
@ -296,8 +297,9 @@ def child_fun():
# message. Just make the parent exit with an error code.
pid, returncode = os.waitpid(pid, 0)
if returncode != 0:
raise CommandError(returncode)
raise InstallError("Installation process had nonzero exit code."
.format(str(returncode)))
class CommandError(StandardError):
pass
class InstallError(SpackError):
"""Raised when a package fails to install"""

View File

@ -32,7 +32,7 @@
from llnl.util.filesystem import *
import spack
from spack.build_environment import CommandError
from spack.build_environment import InstallError
import spack.cmd
description = "Treat package installations as unit tests and output formatted test results"
@ -190,7 +190,7 @@ def test_install(parser, args):
make_jobs=args.jobs,
verbose=True,
fake=False)
except CommandError:
except InstallError:
pass
jrf = JunitResultFormat()