summaryrefslogtreecommitdiff
path: root/src/buildstream/sandbox
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2019-08-14 08:06:48 +0100
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2019-08-14 08:08:23 +0100
commit18fe6a4b01e7abe4fa49a49d4c8ce481a3c1d09e (patch)
tree6932c276ce9d2a0b796b7a580d6e032fd2b18aba /src/buildstream/sandbox
parent64748b53276404155781b9b07080db933b8daaee (diff)
downloadbuildstream-18fe6a4b01e7abe4fa49a49d4c8ce481a3c1d09e.tar.gz
sandbox/sandbox.py: Allow SandboxCommandError to have different reasons
In order to properly support caching failures to build when a sandbox is missing a command, we need to permit SandboxCommandError to take a reason parameter. We default that to that which it previously forced in order to reduce the need to add a reason code to every raise. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
Diffstat (limited to 'src/buildstream/sandbox')
-rw-r--r--src/buildstream/sandbox/sandbox.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buildstream/sandbox/sandbox.py b/src/buildstream/sandbox/sandbox.py
index 6956a7d59..879587748 100644
--- a/src/buildstream/sandbox/sandbox.py
+++ b/src/buildstream/sandbox/sandbox.py
@@ -88,9 +88,10 @@ class SandboxCommandError(SandboxError):
message (str): The error message to report to the user
detail (str): The detailed error string
collect (str): An optional directory containing partial install contents
+ reason (str): An optional reason string (defaults to 'command-failed')
"""
- def __init__(self, message, *, detail=None, collect=None):
- super().__init__(message, detail=detail, reason='command-failed')
+ def __init__(self, message, *, detail=None, collect=None, reason='command-failed'):
+ super().__init__(message, detail=detail, reason=reason)
self.collect = collect