Skip to content
Snippets Groups Projects
Commit 0999af5c authored by tpylak's avatar tpylak
Browse files

LMS-1546, LMS-1584 bugfix: throw exception in case of missing parent dataset

SVN: 16735
parent 6889c84a
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,7 @@ import javax.sql.DataSource;
import net.lemnik.eodsql.QueryTool;
import ch.systemsx.cisd.common.exceptions.EnvironmentFailureException;
import ch.systemsx.cisd.etlserver.plugins.IMigrator;
import ch.systemsx.cisd.openbis.dss.etl.ScreeningContainerDatasetInfo;
import ch.systemsx.cisd.openbis.dss.generic.shared.IEncapsulatedOpenBISService;
......@@ -143,7 +144,12 @@ public abstract class AbstractFeatureVectorMigrator implements IMigrator
for (String dataSetCode : parentDataSetCodes)
{
ExternalData externalData = openBisService.tryGetDataSetForServer(dataSetCode);
if (externalData != null && externalData.getSample() != null)
if (externalData == null)
{
throw new EnvironmentFailureException(
"Cannot find a parent dataset in openBIS: " + dataSetCode);
}
if (externalData.getSample() != null)
{
sampleId = SampleIdentifierFactory.parse(externalData.getSampleIdentifier());
break;
......
......@@ -27,6 +27,7 @@ import javax.sql.DataSource;
import net.lemnik.eodsql.QueryTool;
import ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked;
import ch.systemsx.cisd.common.exceptions.UserFailureException;
import ch.systemsx.cisd.common.mail.IMailClient;
import ch.systemsx.cisd.etlserver.AbstractDelegatingStorageProcessor;
import ch.systemsx.cisd.etlserver.ITypeExtractor;
......@@ -128,6 +129,11 @@ public class FeatureVectorStorageProcessor extends AbstractDelegatingStorageProc
for (String dataSetCode : parentDataSetCodes)
{
ExternalData externalData = openBisService.tryGetDataSetForServer(dataSetCode);
if (externalData == null)
{
throw new UserFailureException("Cannot find a parent dataset in openBIS: "
+ dataSetCode);
}
if (externalData.getSample() != null)
{
sampleOrNull = externalData.getSample();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment