Fail on Vespa 8
@@ -144,7 +144,7 @@ public class DeployState implements ConfigDefinitionStore {
this.zone = zone;
this.queryProfiles = queryProfiles; // TODO: Remove this by seeing how pagetemplates are propagated
this.semanticRules = semanticRules; // TODO: Remove this by seeing how pagetemplates are propagated
- this.importedModels = importMlModels(applicationPackage, modelImporters, deployLogger, executor);
+ this.importedModels = importMlModels(applicationPackage, modelImporters, executor);
this.validationOverrides = applicationPackage.getValidationOverrides().map(ValidationOverrides::fromXml)
.orElse(ValidationOverrides.empty);
@@ -210,15 +210,11 @@ public class DeployState implements ConfigDefinitionStore {
private static ImportedMlModels importMlModels(ApplicationPackage applicationPackage,
Collection<MlModelImporter> modelImporters,
- DeployLogger deployLogger,
ExecutorService executor) {
File importFrom = applicationPackage.getFileReference(ApplicationPackage.MODELS_DIR);
ImportedMlModels importedModels = new ImportedMlModels(importFrom, executor, modelImporters);
- for (var entry : importedModels.getSkippedModels().entrySet()) {
- // TODO: Vespa 8: Throw IllegalArgumentException instead
- deployLogger.logApplicationPackage(Level.WARNING, "Skipping import of model " + entry.getKey() + " as an exception " +
- "occurred during import: " + entry.getValue());
- }
+ for (var entry : importedModels.getSkippedModels().entrySet())
+ throw new IllegalArgumentException("Could not import model '" + entry.getKey() + "': " + entry.getValue());
return importedModels;
}
