More error information
@@ -118,22 +118,34 @@ public class ConvertedModel {
RankProfile rankProfile,
QueryProfileRegistry queryProfileRegistry,
ImportedMlModel importedModel) {
+ try {
ModelStore modelStore = new ModelStore(rankProfile.applicationPackage(), modelName);
return new ConvertedModel(modelName,
modelDescription,
convertAndStore(importedModel, rankProfile, queryProfileRegistry, modelStore),
Optional.of(importedModel));
}
+ catch (IllegalArgumentException e) {
+ throw new IllegalArgumentException("In " + rankProfile + ": Could not create model '" + modelName +
+ " (" + modelDescription + ")", e);
+ }
+ }
public static ConvertedModel fromStore(ModelName modelName,
String modelDescription,
RankProfile rankProfile) {
+ try {
ModelStore modelStore = new ModelStore(rankProfile.applicationPackage(), modelName);
return new ConvertedModel(modelName,
modelDescription,
convertStored(modelStore, rankProfile),
Optional.empty());
}
+ catch (IllegalArgumentException e) {
+ throw new IllegalArgumentException("In " + rankProfile + ": Could not create model '" + modelName +
+ " (" + modelDescription + ")", e);
+ }
+ }
/**
* Returns all the output expressions of this indexed by name. The names consist of one or two parts
