summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbst-marge-bot <marge-bot@buildstream.build>2019-06-14 10:24:09 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-06-14 10:24:09 +0000
commit6a2872f3fe0c5702f073ce4de73cbad7e9ee717c (patch)
tree06df14883509c4cdb31a2c266463b5a7da02fa10
parent9be35e6cef297cef1da43f4cc2dc4ca78a847725 (diff)
parent3395d91eb42302bf64e2c124f0990f7eb44d3962 (diff)
downloadbuildstream-6a2872f3fe0c5702f073ce4de73cbad7e9ee717c.tar.gz
Merge branch 'raoul/unique-error-domains' into 'master'
Make ErrorDomain a unique enumeration See merge request BuildStream/buildstream!1399
-rw-r--r--src/buildstream/_exceptions.py5
-rw-r--r--tests/integration/shellbuildtrees.py2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/buildstream/_exceptions.py b/src/buildstream/_exceptions.py
index f2d34bcba..819f9538c 100644
--- a/src/buildstream/_exceptions.py
+++ b/src/buildstream/_exceptions.py
@@ -18,7 +18,7 @@
# Tristan Van Berkom <tristan.vanberkom@codethink.co.uk>
# Tiago Gomes <tiago.gomes@codethink.co.uk>
-from enum import Enum
+from enum import Enum, unique
import os
# Disable pylint warnings for whole file here:
@@ -79,6 +79,7 @@ def set_last_task_error(domain, reason):
_last_task_error_reason = reason
+@unique
class ErrorDomain(Enum):
PLUGIN = 1
LOAD = 2
@@ -89,13 +90,13 @@ class ErrorDomain(Enum):
PIPELINE = 7
OSTREE = 8
UTIL = 9
- PROG_NOT_FOUND = 12
SOURCE = 10
ELEMENT = 11
APP = 12
STREAM = 13
VIRTUAL_FS = 14
CAS = 15
+ PROG_NOT_FOUND = 16
# BstError is an internal base exception class for BuildSream
diff --git a/tests/integration/shellbuildtrees.py b/tests/integration/shellbuildtrees.py
index 78dad8747..e53003757 100644
--- a/tests/integration/shellbuildtrees.py
+++ b/tests/integration/shellbuildtrees.py
@@ -286,7 +286,7 @@ def test_buildtree_options(cli, tmpdir, datafiles):
res = cli.run(project=project, args=[
'shell', '--build', element_name, '--use-buildtree', 'always', '--', 'cat', 'test'
])
- res.assert_main_error(ErrorDomain.PROG_NOT_FOUND, None)
+ res.assert_main_error(ErrorDomain.APP, None)
assert 'Buildtree is not cached locally or in available remotes' in res.stderr
assert 'Hi' not in res.output
assert 'Attempting to fetch missing artifact buildtree' not in res.stderr