summaryrefslogtreecommitdiff
path: root/buildstream/_exceptions.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-01 20:42:50 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-01 20:50:59 +0900
commit63d9946357d655b0af56202d4fba37ae3f8c5f06 (patch)
treeb310f8db43c6a9832869094e9de2bb31c76bb393 /buildstream/_exceptions.py
parentb9546d4de7447e2f013cd263151d5d4a596e2dfe (diff)
downloadbuildstream-63d9946357d655b0af56202d4fba37ae3f8c5f06.tar.gz
Include initialization time in the total session time of the build log
This patch refactors the frontend App object and touches a few internals. o The scheduler now takes a start time given to it at instantiation time, instead of considering the start time to commence in Scheduler.run() o The App.initialize() method has been swapped out for an App.initialized() context manager. This context manager now takes care of the main start/fail/success messages. For convenience and ensured consistency, this context manager is now responsible for: o Printing the startup heading o Printing the end of session summary o Exiting with a consistent error status in case of errors o The Pipeline() object no longer prints the start/fail/success messages, as they are now taken care of by the App() o The cli.py frontend code is much simplified by using the new context manager, also enforcing consistency in how we handle and report errors. This fixes issue #186
Diffstat (limited to 'buildstream/_exceptions.py')
-rw-r--r--buildstream/_exceptions.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/buildstream/_exceptions.py b/buildstream/_exceptions.py
index 8a4f13aea..fb42d9fd2 100644
--- a/buildstream/_exceptions.py
+++ b/buildstream/_exceptions.py
@@ -220,7 +220,7 @@ class ArtifactError(BstError):
#
class PipelineError(BstError):
- def __init__(self, message=None, *, detail=None, reason=None):
+ def __init__(self, message=None, *, detail=None, reason=None, terminated=False):
# The empty string should never appear to a user,
# this only allows us to treat this internal error as
@@ -229,3 +229,5 @@ class PipelineError(BstError):
message = ""
super().__init__(message, detail=detail, domain=ErrorDomain.PIPELINE, reason=reason)
+
+ self.terminated = terminated