diff options
author | knownexus <phillip.smyth@codethink.co.uk> | 2018-09-13 17:02:28 +0100 |
---|---|---|
committer | Phillip Smyth <phillip.smyth@codethink.co.uk> | 2018-09-18 16:45:09 +0000 |
commit | ba4da3a4806e8f433e210e69d2ee60f247c8d649 (patch) | |
tree | 90721a82e9bd6fa2cd2c52d19895aa6ff3ecce78 /buildstream/_project.py | |
parent | d8450166db2dc72e43018a48e2cbc6f546af05f8 (diff) | |
download | buildstream-ba4da3a4806e8f433e210e69d2ee60f247c8d649.tar.gz |
Incorrect error when malformed project.conf
bst build returns "missing project.conf" when a project.conf is invalid
This results in an existing project with malformed yaml being dismissed
and attempts to make a new project
Added new exception
Diffstat (limited to 'buildstream/_project.py')
-rw-r--r-- | buildstream/_project.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/buildstream/_project.py b/buildstream/_project.py index 03a783e48..b72318af9 100644 --- a/buildstream/_project.py +++ b/buildstream/_project.py @@ -385,7 +385,10 @@ class Project(): self._project_conf = _yaml.load(projectfile) except LoadError as e: # Raise a more specific error here - raise LoadError(LoadErrorReason.MISSING_PROJECT_CONF, str(e)) + if e.reason == LoadErrorReason.MISSING_FILE: + raise LoadError(LoadErrorReason.MISSING_PROJECT_CONF, str(e)) from e + else: + raise pre_config_node = _yaml.node_copy(self._default_config_node) _yaml.composite(pre_config_node, self._project_conf) |