Skip to content
Snippets Groups Projects
Commit fce84171 authored by knownexus's avatar knownexus
Browse files

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
parent 3b81d451
No related branches found
No related tags found
No related merge requests found
Pipeline #30127759 passed
......@@ -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))
elif e.reason == LoadErrorReason.INVALID_YAML:
raise LoadError(LoadErrorReason.INVALID_YAML, str(e))
pre_config_node = _yaml.node_copy(self._default_config_node)
_yaml.composite(pre_config_node, self._project_conf)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment