summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-08 11:55:58 -0500
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-08 11:55:58 -0500
commit81f7a964946b6f6b082b697d6aefe9ff7cb811a5 (patch)
treee9100a3680600749f2445f9fdec9a0054ccb4ea9
parent914ecb72a28844a9edb6cbfb328276e0225d430d (diff)
downloadbuildstream-tristan/sandbox-programming-error.tar.gz
sandbox/sandbox.py: Use assertions for programming errors instead of BstErrors.tristan/sandbox-programming-error
When code is faulty, in a plugin or in the core, we should get a stack trace and a BUG message.
-rw-r--r--buildstream/sandbox/sandbox.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/buildstream/sandbox/sandbox.py b/buildstream/sandbox/sandbox.py
index 617ebf5f5..4a1e81008 100644
--- a/buildstream/sandbox/sandbox.py
+++ b/buildstream/sandbox/sandbox.py
@@ -288,8 +288,8 @@ class Sandbox():
command = [command]
if self.__batch:
- if flags != self.__batch.flags:
- raise SandboxError("Inconsistent sandbox flags in single command batch")
+ assert flags == self.__batch.flags, \
+ "Inconsistent sandbox flags in single command batch"
batch_command = _SandboxBatchCommand(command, cwd=cwd, env=env, label=label)
@@ -326,8 +326,8 @@ class Sandbox():
if self.__batch:
# Nested batch
- if flags != self.__batch.flags:
- raise SandboxError("Inconsistent sandbox flags in single command batch")
+ assert flags == self.__batch.flags, \
+ "Inconsistent sandbox flags in single command batch"
parent_group = self.__batch.current_group
parent_group.append(group)