diff --git a/src/main/java/org/filteredpush/qc/metadata/DwCMetadataDQ.java b/src/main/java/org/filteredpush/qc/metadata/DwCMetadataDQ.java index 67545ab..8e2e85c 100644 --- a/src/main/java/org/filteredpush/qc/metadata/DwCMetadataDQ.java +++ b/src/main/java/org/filteredpush/qc/metadata/DwCMetadataDQ.java @@ -1988,11 +1988,11 @@ public static DQResponse amendmentSexStandardized( try { MetadataSourceAuthority sourceAuthorityObject = new MetadataSourceAuthority(sourceAuthority); if (sourceAuthorityObject.getAuthority().equals(EnumMetadataSourceAuthority.INVALID)) { - result.setResultState(ResultState.EXTERNAL_PREREQUISITES_NOT_MET); + throw new SourceAuthorityException("Invalid source authority"); } if (!MetadataSingleton.getInstance().isLoaded()) { result.addComment("Error accessing sourceAuthority: " + MetadataSingleton.getInstance().getLoadError() ); - result.setResultState(ResultState.EXTERNAL_PREREQUISITES_NOT_MET); + throw new SourceAuthorityException("Error loading data from sourceAuthority"); } else { if (MetadataSingleton.getInstance().getSexTerms().containsKey(sex)) { result.addComment("Provided value of dwc:sex found in the sourceAuthority"); @@ -2161,11 +2161,11 @@ public static DQResponse amendmentTypestatusStandardized( try { MetadataSourceAuthority sourceAuthorityObject = new MetadataSourceAuthority(sourceAuthority); if (sourceAuthorityObject.getAuthority().equals(EnumMetadataSourceAuthority.INVALID)) { - result.setResultState(ResultState.EXTERNAL_PREREQUISITES_NOT_MET); + throw new SourceAuthorityException("Invalid source authority"); } if (!MetadataSingleton.getInstance().isLoaded()) { result.addComment("Error accessing sourceAuthority: " + MetadataSingleton.getInstance().getLoadError() ); - result.setResultState(ResultState.EXTERNAL_PREREQUISITES_NOT_MET); + throw new SourceAuthorityException("Error loading data from sourceAuthority"); } else { if (MetadataSingleton.getInstance().getTypeStatusTerms().containsKey(typeStatus)) { result.addComment("Provided value of dwc:typeStatus found in the sourceAuthority");