Better error handling loading resources
This commit is contained in:
parent
bb94efa873
commit
5e2330c6e2
|
@ -126,7 +126,9 @@ public abstract class ParserBase {
|
|||
|
||||
public Element parseSingle(InputStream stream) throws IOException, FHIRFormatError, DefinitionException, FHIRException {
|
||||
List<NamedElement> res = parse(stream);
|
||||
if (res.size() == 0) {
|
||||
if (res == null) {
|
||||
throw new FHIRException("Parsing FHIR content failed: "+errors.get(0).summary());
|
||||
} else if (res.size() == 0) {
|
||||
throw new FHIRException("Parsing FHIR content returned no elements in a context where one element is required");
|
||||
}
|
||||
if (res.size() != 1) {
|
||||
|
|
Loading…
Reference in New Issue