Search in sources :

Example 1 with GoConfigInvalidMergeException

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;
}
Also used : GoConfigInvalidMergeException(com.thoughtworks.go.config.exceptions.GoConfigInvalidMergeException) GoConfigInvalidException(com.thoughtworks.go.config.exceptions.GoConfigInvalidException) ConfigErrors(com.thoughtworks.go.domain.ConfigErrors)

Aggregations

GoConfigInvalidException (com.thoughtworks.go.config.exceptions.GoConfigInvalidException)1 GoConfigInvalidMergeException (com.thoughtworks.go.config.exceptions.GoConfigInvalidMergeException)1 ConfigErrors (com.thoughtworks.go.domain.ConfigErrors)1