Phillip Smyth pushed to branch issue-642-Invalid_project.conf_seen_as_missing at BuildStream / buildstream
Commits:
-
0c79d9e0
by knownexus at 2018-09-13T16:12:15Z
2 changed files:
Changes:
... | ... | @@ -223,6 +223,9 @@ class LoadErrorReason(Enum): |
223 | 223 |
# An attempt so set the value of a protected variable
|
224 | 224 |
PROTECTED_VARIABLE_REDEFINED = 23
|
225 | 225 |
|
226 |
+ # A project.conf file was invalid
|
|
227 |
+ INVALID_PROJECT_CONF = 24
|
|
228 |
+ |
|
226 | 229 |
|
227 | 230 |
# LoadError
|
228 | 231 |
#
|
... | ... | @@ -385,7 +385,10 @@ class Project(): |
385 | 385 |
self._project_conf = _yaml.load(projectfile)
|
386 | 386 |
except LoadError as e:
|
387 | 387 |
# Raise a more specific error here
|
388 |
- raise LoadError(LoadErrorReason.MISSING_PROJECT_CONF, str(e))
|
|
388 |
+ if e.reason == LoadErrorReason.MISSING_FILE:
|
|
389 |
+ raise LoadError(LoadErrorReason.MISSING_PROJECT_CONF, str(e))
|
|
390 |
+ elif e.reason == LoadErrorReason.INVALID_YAML:
|
|
391 |
+ raise LoadError(LoadErrorReason.INVALID_PROJECT_CONF, str(e))
|
|
389 | 392 |
|
390 | 393 |
pre_config_node = _yaml.node_copy(self._default_config_node)
|
391 | 394 |
_yaml.composite(pre_config_node, self._project_conf)
|