summaryrefslogtreecommitdiff
path: root/src/buildstream/_exceptions.py
diff options
context:
space:
mode:
authorTom Pollard <tom.pollard@codethink.co.uk>2019-11-14 14:11:08 +0000
committerTom Pollard <tom.pollard@codethink.co.uk>2019-11-14 14:34:29 +0000
commitb6ff02a198bd65c3e356ada1bb711d236e6a772f (patch)
tree35fd79b0beae2380baed1744db9de89fd05046e1 /src/buildstream/_exceptions.py
parentc3eee615fb5fe957d17151ff655ebebc3d029681 (diff)
downloadbuildstream-b6ff02a198bd65c3e356ada1bb711d236e6a772f.tar.gz
_profile.py: Raise exception if invalid BST_PROFILE topics
This is implemented with a new ProfileError, ensuring a user doesn't wait for a profile to complete that was never valid.
Diffstat (limited to 'src/buildstream/_exceptions.py')
-rw-r--r--src/buildstream/_exceptions.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/buildstream/_exceptions.py b/src/buildstream/_exceptions.py
index 947b83149..46de90796 100644
--- a/src/buildstream/_exceptions.py
+++ b/src/buildstream/_exceptions.py
@@ -97,6 +97,7 @@ class ErrorDomain(Enum):
CAS = 14
PROG_NOT_FOUND = 15
REMOTE = 16
+ PROFILE = 17
# BstError is an internal base exception class for BuildStream
@@ -378,3 +379,12 @@ class SkipJob(Exception):
class ArtifactElementError(BstError):
def __init__(self, message, *, detail=None, reason=None):
super().__init__(message, detail=detail, domain=ErrorDomain.ELEMENT, reason=reason)
+
+
+# ProfileError
+#
+# Raised when a user provided profile choice isn't valid
+#
+class ProfileError(BstError):
+ def __init__(self, message, detail=None, reason=None):
+ super().__init__(message, detail=detail, domain=ErrorDomain.PROFILE, reason=reason)