Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public class ExperimentUtilities {
public static final String MULTIPLE_EXP_TITLES = "File contains more than one Experiment Title";
public static final String PREEXISTING_EXPERIMENT_TITLE = "Experiment Title already exists";
public static final String MISSING_OBS_UNIT_ID_ERROR = "Experimental entities are missing ObsUnitIDs";
public static final String UNMATCHED_COLUMN = "Ontology term(s) not found: ";



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public AppendOverwriteMiddlewareContext process(AppendOverwriteMiddlewareContext
context.getAppendOverwriteWorkflowContext().setPendingObservationByHash(pendingObservationByHash);

return processNext(context);
} catch (DoesNotExistException | ApiException | UnprocessableEntityException | ValidatorException e) {
} catch (DoesNotExistException | ApiException | UnprocessableEntityException | ValidatorException | IllegalStateException e) {
context.getAppendOverwriteWorkflowContext().setProcessError(new MiddlewareException(e));
return this.compensate(context);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public List<BrAPIObservationUnit> getObservationUnitsByDbId(Set<String> expUnitI
missingIds.removeAll(brapiUnits.stream().map(BrAPIObservationUnit::getObservationUnitDbId).collect(Collectors.toSet()));

// Throw exception with missing IDs information
throw new IllegalStateException("Observation unit not found for unit dbid(s): " + String.join(COMMA_DELIMITER, missingIds));
throw new IllegalStateException(ExperimentUtilities.UNMATCHED_COLUMN + String.join(COMMA_DELIMITER, missingIds));
}

return brapiUnits;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.micronaut.http.HttpStatus;
import org.apache.commons.lang3.StringUtils;
import org.breedinginsight.api.model.v1.response.ValidationError;
import org.breedinginsight.brapps.importer.services.processors.experiment.ExperimentUtilities;
import org.breedinginsight.brapps.importer.services.processors.experiment.model.ExpImportProcessConstants;
import org.breedinginsight.model.Program;
import org.breedinginsight.model.Trait;
Expand Down Expand Up @@ -69,7 +70,7 @@ public List<Trait> fetchTraitsByName(Set<String> varNames, Program program) thro
if (varNames.size() != traits.size()) {
Set<String> missingVarNames = new HashSet<>(varNames);
missingVarNames.removeAll(traits.stream().map(TraitEntity::getObservationVariableName).collect(Collectors.toSet()));
throw new IllegalStateException("Observation variables not found for name(s): " + String.join(ExpImportProcessConstants.COMMA_DELIMITER, missingVarNames));
throw new DoesNotExistException(ExperimentUtilities.UNMATCHED_COLUMN + String.join(ExpImportProcessConstants.COMMA_DELIMITER, missingVarNames));
}

return traits;
Expand Down