diff options
author | bst-marge-bot <marge-bot@buildstream.build> | 2019-03-20 17:12:12 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-03-20 17:12:12 +0000 |
commit | 408c38a60f78c54ebaf2b6651cc3898d471cab15 (patch) | |
tree | b6ab338acd17311a0e6a691cb31e7b5899847cef | |
parent | eb12178d7e3ab6e2e6a029e644c1ed55607148cb (diff) | |
parent | 4224df86153d0ff6501f41512bd861de2614d6c5 (diff) | |
download | buildstream-408c38a60f78c54ebaf2b6651cc3898d471cab15.tar.gz |
Merge branch 'aevri/element_loaderror_detail' into 'master'
element: keep original 'detail' when re-raising
See merge request BuildStream/buildstream!1240
-rw-r--r-- | buildstream/element.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index e5bc0792e..35f656fca 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -494,7 +494,7 @@ class Element(Plugin): return self.__variables.subst(value) except LoadError as e: provenance = _yaml.node_get_provenance(node, key=member_name) - raise LoadError(e.reason, '{}: {}'.format(provenance, str(e))) from e + raise LoadError(e.reason, '{}: {}'.format(provenance, e), detail=e.detail) from e def node_subst_list(self, node, member_name): """Fetch a list from a node member, substituting any variables in the list @@ -520,7 +520,7 @@ class Element(Plugin): ret.append(self.__variables.subst(x)) except LoadError as e: provenance = _yaml.node_get_provenance(node, key=member_name, indices=[index]) - raise LoadError(e.reason, '{}: {}'.format(provenance, str(e))) from e + raise LoadError(e.reason, '{}: {}'.format(provenance, e), detail=e.detail) from e return ret def node_subst_list_element(self, node, member_name, indices): @@ -562,7 +562,7 @@ class Element(Plugin): return self.__variables.subst(value) except LoadError as e: provenance = _yaml.node_get_provenance(node, key=member_name, indices=indices) - raise LoadError(e.reason, '{}: {}'.format(provenance, str(e))) from e + raise LoadError(e.reason, '{}: {}'.format(provenance, e), detail=e.detail) from e def compute_manifest(self, *, include=None, exclude=None, orphans=True): """Compute and return this element's selective manifest @@ -1330,7 +1330,7 @@ class Element(Plugin): self.preflight() except BstError as e: # Prepend provenance to the error - raise ElementError("{}: {}".format(self, e), reason=e.reason) from e + raise ElementError("{}: {}".format(self, e), reason=e.reason, detail=e.detail) from e # Ensure that the first source does not need access to previous soruces if self.__sources and self.__sources[0]._requires_previous_sources(): |