From 8b5742dd8b3d6e437703ca02553804ce7cc9d53d Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Mon, 2 Apr 2018 19:53:59 +0900 Subject: _exceptions.py: Adding new AppError exception and error domain --- buildstream/_exceptions.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/buildstream/_exceptions.py b/buildstream/_exceptions.py index fb42d9fd2..27045bece 100644 --- a/buildstream/_exceptions.py +++ b/buildstream/_exceptions.py @@ -70,6 +70,7 @@ class ErrorDomain(Enum): PROG_NOT_FOUND = 12 SOURCE = 10 ELEMENT = 11 + APP = 12 # BstError is an internal base exception class for BuildSream @@ -231,3 +232,12 @@ class PipelineError(BstError): super().__init__(message, detail=detail, domain=ErrorDomain.PIPELINE, reason=reason) self.terminated = terminated + + +# AppError +# +# Raised from the frontend App directly +# +class AppError(BstError): + def __init__(self, message, detail=None, reason=None): + super().__init__(message, detail=detail, domain=ErrorDomain.APP, reason=reason) -- cgit v1.2.1