use of alien4cloud.tosca.parser.ParsingException in project alien4cloud by alien4cloud.
the class MockAmazonLocationConfigurer method getMatchingConfigurations.
@Override
public Map<String, MatchingConfiguration> getMatchingConfigurations() {
Path matchingConfigPath = selfContext.getPluginPath().resolve("aws/mock-resources-matching-config.yml");
MatchingConfigurations matchingConfigurations = null;
try {
matchingConfigurations = matchingConfigurationsParser.parseFile(matchingConfigPath).getResult();
} catch (ParsingException e) {
return Maps.newHashMap();
}
return matchingConfigurations.getMatchingConfigurations();
}
use of alien4cloud.tosca.parser.ParsingException in project yorc-a4c-plugin by ystia.
the class PluginArchiveService method parsePluginArchives.
public PluginArchive parsePluginArchives(String archiveRelativePath) {
// Parse the archives
ParsingResult<ArchiveRoot> result;
Path archivePath = selfContext.getPluginPath().resolve(archiveRelativePath);
try {
result = this.archiveParser.parseDir(archivePath, AlienConstants.GLOBAL_WORKSPACE_ID);
} catch (ParsingException e) {
log.error("Failed to parse archive, plugin won't work", e);
throw new RuntimeException("Failed to parse archive, plugin won't work", e);
}
if (result.getContext().getParsingErrors() != null && !result.getContext().getParsingErrors().isEmpty()) {
log.error("Parsing errors for " + archiveRelativePath);
for (ParsingError parsingError : result.getContext().getParsingErrors()) {
log.error(parsingError.toString());
}
throw new RuntimeException("Plugin archive is invalid, plugin won't work");
}
return new PluginArchive(result.getResult(), archivePath);
}
Aggregations