don't suppress error when FML doesn't parse

This commit is contained in:
Grahame Grieve 2023-03-28 07:44:44 +11:00
parent 36e00215ea
commit d43d6ce19a
1 changed files with 10 additions and 2 deletions

View File

@ -108,9 +108,17 @@ public class FmlParser extends ParserBase {
parseGroup(result, lexer);
}
} catch (FHIRLexerException e) {
logError("2023-02-24", e.getLocation().getLine(), e.getLocation().getColumn(), "??", IssueType.INVALID, e.getMessage(), IssueSeverity.FATAL);
if (policy == ValidationPolicy.NONE) {
throw e;
} else {
logError("2023-02-24", e.getLocation().getLine(), e.getLocation().getColumn(), "??", IssueType.INVALID, e.getMessage(), IssueSeverity.FATAL);
}
} catch (Exception e) {
logError("2023-02-24", -1, -1, "?", IssueType.INVALID, e.getMessage(), IssueSeverity.FATAL);
if (policy == ValidationPolicy.NONE) {
throw e;
} else {
logError("2023-02-24", -1, -1, "?", IssueType.INVALID, e.getMessage(), IssueSeverity.FATAL);
}
}
result.setIgnorePropertyOrder(true);
return result;