Fix the server exception when validating an invalid local reference

'fetcher == null' is ok for a local reference.

Unfortunately, there are now two messages with the same meaning:
- one from the ProfileValidation
- one from the code in this location
This commit is contained in:
Heinz-Dieter Conradi 2018-03-01 10:48:30 +01:00 committed by Heinz-Dieter Conradi
parent f2cd05fe3b
commit b2107baae4
1 changed files with 6 additions and 3 deletions

View File

@ -1563,9 +1563,12 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (pol.checkExists()) {
if (we == null) {
if (fetcher == null)
throw new FHIRException("Resource resolution services not provided");
we = fetcher.fetch(hostContext.appContext, ref);
if (fetcher == null) {
if (!refType.equals("contained"))
throw new FHIRException("Resource resolution services not provided");
} else {
we = fetcher.fetch(hostContext.appContext, ref);
}
}
rule(errors, IssueType.STRUCTURE, element.line(), element.col(), path, we != null, "Unable to resolve resource '"+ref+"'");
}