diff options
Diffstat (limited to 'buildstream/_exceptions.py')
-rw-r--r-- | buildstream/_exceptions.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/buildstream/_exceptions.py b/buildstream/_exceptions.py index d8687104f..bcea65a8d 100644 --- a/buildstream/_exceptions.py +++ b/buildstream/_exceptions.py @@ -88,6 +88,7 @@ class ErrorDomain(Enum): SOURCE = 10 ELEMENT = 11 APP = 12 + STREAM = 13 # BstError is an internal base exception class for BuildSream @@ -252,10 +253,20 @@ class ArtifactError(BstError): # PipelineError # -# Raised when a pipeline fails +# Raised from pipeline operations # class PipelineError(BstError): + def __init__(self, message, *, detail=None, reason=None): + super().__init__(message, detail=detail, domain=ErrorDomain.PIPELINE, reason=reason) + + +# StreamError +# +# Raised when a stream operation fails +# +class StreamError(BstError): + def __init__(self, message=None, *, detail=None, reason=None, terminated=False): # The empty string should never appear to a user, @@ -264,7 +275,7 @@ class PipelineError(BstError): if message is None: message = "" - super().__init__(message, detail=detail, domain=ErrorDomain.PIPELINE, reason=reason) + super().__init__(message, detail=detail, domain=ErrorDomain.STREAM, reason=reason) self.terminated = terminated |