Skip to content

Commit ef992db

Browse files
GH Issue 594: Update messaging related to parent samples/sources not found during import (#7790)
1 parent ceffad5 commit ef992db

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

experiment/src/client/test/integration/utils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,10 @@ export async function verifyRequiredLineageInsertUpdate(server: IntegrationTestS
732732
failedImportResp = await ExperimentCRUDUtils.importData(server, 'name\t' + parentInput + '\nCData3\t', dataType, 'IMPORT', topFolderOptions, editorUserOptions, false, false, isChildSample, true);
733733
expect(JSON.parse(failedImportResp.text).exception).toBe('Missing value for required property: ' + parentInput);
734734
failedImportResp = await ExperimentCRUDUtils.importData(server, 'name\t' + parentInput + '\nCData3\tbadparentname', dataType, 'IMPORT', topFolderOptions, editorUserOptions, false, false, isChildSample, true);
735-
expect(JSON.parse(failedImportResp.text).exception).toContain("'badparentname' not found in");
735+
if (isParentSample)
736+
expect(JSON.parse(failedImportResp.text).exception).toContain("Parent sample 'badparentname' from Sample Type '" + parentDataType + "' not found in the current context.");
737+
else
738+
expect(JSON.parse(failedImportResp.text).exception).toContain("Data input 'badparentname' from Data Class '" + parentDataType + "' not found in the current context.");
736739
failedImportResp = await ExperimentCRUDUtils.importData(server, 'name\tpAlias\nCData3\t', dataType, 'IMPORT', topFolderOptions, editorUserOptions, false, false, isChildSample, true);
737740
expect(JSON.parse(failedImportResp.text).exception).toBe('Missing value for required property: pAlias');
738741
failedImportResp = await ExperimentCRUDUtils.importData(server, 'name\nCData3', dataType, 'MERGE', topFolderOptions, editorUserOptions, false, false, isChildSample, true);
@@ -942,4 +945,4 @@ export function generateFieldNameForImport(length: number = 10, charset?: string
942945
fieldName = generateFieldName(length, charset);
943946
}
944947
return fieldName;
945-
}
948+
}

experiment/src/org/labkey/experiment/ExpDataIterators.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ else if (aliasPrefix != null && aliasSuffix != null)
19331933
if (sample != null)
19341934
parentMaterials.put(sample, sampleRole(sample));
19351935
else
1936-
throw new ValidationException("Sample '" + entityName + "' not found in Sample Type '" + namePart + "'.");
1936+
throw new ValidationException("Parent sample '" + entityName + "' from Sample Type '" + namePart + "' not found in the current context.");
19371937

19381938
}
19391939
}
@@ -2002,9 +2002,9 @@ else if (DATA_INPUT_PARENT.equalsIgnoreCase(aliasPrefix))
20022002
{
20032003

20042004
if (ExpSchema.DataClassCategoryType.sources.name().equalsIgnoreCase(dataClass.getCategory()))
2005-
throw new ValidationException("Source '" + entityName + "' not found in Source Type '" + namePart + "'.");
2005+
throw new ValidationException("Source '" + entityName + "' from Source Type '" + namePart + "' not found in the current context.");
20062006
else
2007-
throw new ValidationException("Data input '" + entityName + "' not found in Data Class '" + namePart + "'.");
2007+
throw new ValidationException("Data input '" + entityName + "' from Data Class '" + namePart + "' not found in the current context.");
20082008
}
20092009
}
20102010
}

0 commit comments

Comments
 (0)