Commit ba4da3a4 authored by knownexus's avatar knownexus Committed by Phillip Smyth
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 d8450166
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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)