diff options
Diffstat (limited to 'lib/spack/spack/exception.py')
-rw-r--r-- | lib/spack/spack/exception.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/spack/spack/exception.py b/lib/spack/spack/exception.py new file mode 100644 index 0000000000..815cd9be25 --- /dev/null +++ b/lib/spack/spack/exception.py @@ -0,0 +1,23 @@ + + +class SpackException(Exception): + def __init__(self, message): + self.message = message + + +class FailedDownloadException(SpackException): + def __init__(self, url): + super(FailedDownloadException, self).__init__("Failed to fetch file from URL: " + url) + self.url = url + + +class InvalidPackageNameException(SpackException): + def __init__(self, name): + super(InvalidPackageNameException, self).__init__("Invalid package name: " + name) + self.name = name + + +class CommandFailedException(SpackException): + def __init__(self, command): + super(CommandFailedException, self).__init__("Failed to execute command: " + command) + self.command = command |