summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelos Evripiotis <jevripiotis@bloomberg.net>2019-03-14 13:21:34 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-03-15 11:09:31 +0000
commitbbbe1f14e0c2644f62c628406c0a26fc9bb67554 (patch)
tree92959ce7c011bbc231176ab90dd97d3b71fa53a7
parent9ccf3b476e54034f198102ed9858a8072acf4729 (diff)
downloadbuildstream-bbbe1f14e0c2644f62c628406c0a26fc9bb67554.tar.gz
loader: clearer error if no junction project.conf
I found the original message confusing - it would talk about wanting a project at '.', without a frame of reference. After re-reading the code and junction docs it made more sense, I think this version would save folks the trouble. Removing all mention of it, if it's not specified. If it is specified then explain it a bit more, i.e. Before: Could not find the project.conf file for junction element at hello-junction.bst [line 1 column 0]. Expecting a project at path 'project' After: Could not find the project.conf file in project referred to by junction element 'hello-junction.bst'. Was expecting it at path 'project' in the junction's source. If no 'path' specified in the junction: Could not find the project.conf file in project referred to by junction element 'hello-junction.bst'.
-rw-r--r--buildstream/_loader/loader.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/buildstream/_loader/loader.py b/buildstream/_loader/loader.py
index 9b91e91fe..f7fd3203e 100644
--- a/buildstream/_loader/loader.py
+++ b/buildstream/_loader/loader.py
@@ -570,10 +570,14 @@ class Loader():
parent_loader=self)
except LoadError as e:
if e.reason == LoadErrorReason.MISSING_PROJECT_CONF:
+ message = (
+ "Could not find the project.conf file in the project "
+ "referred to by junction element '{}'.".format(element.name)
+ )
+ if element.path:
+ message += " Was expecting it at path '{}' in the junction's source.".format(element.path)
raise LoadError(reason=LoadErrorReason.INVALID_JUNCTION,
- message="Could not find the project.conf file for {}. "
- "Expecting a project at path '{}'"
- .format(element, element.path or '.')) from e
+ message=message) from e
else:
raise