summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelos Evripiotis <jevripiotis@bloomberg.net>2019-03-15 17:45:32 +0000
committerAngelos Evripiotis <jevripiotis@bloomberg.net>2019-03-15 18:23:32 +0000
commit6937f7f7c64385766443a41dbf9be2afaef55a14 (patch)
tree456fb632c8d6135ad35cf21653496e1457c46275
parentce86e5557ab8b43276f4cb2892f20bcae560a53c (diff)
downloadbuildstream-aevri/provenance_scope.tar.gz
optionpool: use context_for_bsterroraevri/provenance_scope
-rw-r--r--buildstream/_options/optionpool.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/buildstream/_options/optionpool.py b/buildstream/_options/optionpool.py
index 3132af564..716be7710 100644
--- a/buildstream/_options/optionpool.py
+++ b/buildstream/_options/optionpool.py
@@ -22,7 +22,7 @@ from collections.abc import Mapping
import jinja2
from .. import _yaml
-from .._exceptions import LoadError, LoadErrorReason
+from .._exceptions import LoadError, LoadErrorReason, context_for_bsterror
from .optionbool import OptionBool
from .optionenum import OptionEnum
from .optionflags import OptionFlags
@@ -277,11 +277,8 @@ class OptionPool():
"{}: Conditional statement has more than one key".format(p))
expression, value = tuples[0]
- try:
+ with context_for_bsterror(p):
apply_fragment = self._evaluate(expression)
- except LoadError as e:
- # Prepend the provenance of the error
- raise LoadError(e.reason, "{}: {}".format(p, e)) from e
if not hasattr(value, 'get'):
raise LoadError(LoadErrorReason.ILLEGAL_COMPOSITE,