diff --git a/experiment/src/client/test/integration/utils.ts b/experiment/src/client/test/integration/utils.ts index 290dcbdb6dd..bd0f4e50650 100644 --- a/experiment/src/client/test/integration/utils.ts +++ b/experiment/src/client/test/integration/utils.ts @@ -732,7 +732,10 @@ export async function verifyRequiredLineageInsertUpdate(server: IntegrationTestS failedImportResp = await ExperimentCRUDUtils.importData(server, 'name\t' + parentInput + '\nCData3\t', dataType, 'IMPORT', topFolderOptions, editorUserOptions, false, false, isChildSample, true); expect(JSON.parse(failedImportResp.text).exception).toBe('Missing value for required property: ' + parentInput); failedImportResp = await ExperimentCRUDUtils.importData(server, 'name\t' + parentInput + '\nCData3\tbadparentname', dataType, 'IMPORT', topFolderOptions, editorUserOptions, false, false, isChildSample, true); - expect(JSON.parse(failedImportResp.text).exception).toContain("'badparentname' not found in"); + if (isParentSample) + expect(JSON.parse(failedImportResp.text).exception).toContain("Parent sample 'badparentname' from Sample Type '" + parentDataType + "' not found in the current context."); + else + expect(JSON.parse(failedImportResp.text).exception).toContain("Data input 'badparentname' from Data Class '" + parentDataType + "' not found in the current context."); failedImportResp = await ExperimentCRUDUtils.importData(server, 'name\tpAlias\nCData3\t', dataType, 'IMPORT', topFolderOptions, editorUserOptions, false, false, isChildSample, true); expect(JSON.parse(failedImportResp.text).exception).toBe('Missing value for required property: pAlias'); 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 fieldName = generateFieldName(length, charset); } return fieldName; -} \ No newline at end of file +} diff --git a/experiment/src/org/labkey/experiment/ExpDataIterators.java b/experiment/src/org/labkey/experiment/ExpDataIterators.java index 1d7707ed0a1..841ce6bf8d2 100644 --- a/experiment/src/org/labkey/experiment/ExpDataIterators.java +++ b/experiment/src/org/labkey/experiment/ExpDataIterators.java @@ -1933,7 +1933,7 @@ else if (aliasPrefix != null && aliasSuffix != null) if (sample != null) parentMaterials.put(sample, sampleRole(sample)); else - throw new ValidationException("Sample '" + entityName + "' not found in Sample Type '" + namePart + "'."); + throw new ValidationException("Parent sample '" + entityName + "' from Sample Type '" + namePart + "' not found in the current context."); } } @@ -2002,9 +2002,9 @@ else if (DATA_INPUT_PARENT.equalsIgnoreCase(aliasPrefix)) { if (ExpSchema.DataClassCategoryType.sources.name().equalsIgnoreCase(dataClass.getCategory())) - throw new ValidationException("Source '" + entityName + "' not found in Source Type '" + namePart + "'."); + throw new ValidationException("Source '" + entityName + "' from Source Type '" + namePart + "' not found in the current context."); else - throw new ValidationException("Data input '" + entityName + "' not found in Data Class '" + namePart + "'."); + throw new ValidationException("Data input '" + entityName + "' from Data Class '" + namePart + "' not found in the current context."); } } }