use of com.thoughtworks.go.config.exceptions.GoConfigInvalidMergeException in project gocd by gocd.
the class MagicalGoConfigXmlLoader method validateCruiseConfig.
public CruiseConfig validateCruiseConfig(CruiseConfig config) throws Exception {
LOGGER.debug("[Config Save] In validateCruiseConfig: Starting.");
List<ConfigErrors> allErrors = validate(config);
if (!allErrors.isEmpty()) {
if (config.isLocal())
throw new GoConfigInvalidException(config, allErrors);
else
throw new GoConfigInvalidMergeException(config, config.getMergedPartials(), allErrors);
}
LOGGER.debug("[Config Save] In validateCruiseConfig: Running validate.");
for (GoConfigValidator validator : VALIDATORS) {
validator.validate(config);
}
LOGGER.debug("[Config Save] In validateCruiseConfig: Done.");
return config;
}
Aggregations