Skip to content

Commit

Permalink
Bugfixes to handling of problems with source authority in tdwg/bdq#284
Browse files Browse the repository at this point in the history
…and tdwg/bdq#286, need to throw exception on invalid.
  • Loading branch information
chicoreus committed Aug 2, 2024
1 parent e6339e2 commit 807f585
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/filteredpush/qc/metadata/DwCMetadataDQ.java
Original file line number Diff line number Diff line change
Expand Up @@ -1988,11 +1988,11 @@ public static DQResponse<AmendmentValue> 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");
Expand Down Expand Up @@ -2161,11 +2161,11 @@ public static DQResponse<AmendmentValue> 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");
Expand Down

0 comments on commit 807f585

Please sign in to comment.