Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5368-Lenient-error-handler-doesn't-always-include-location-information #6678

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public LenientErrorHandler(boolean theLogErrors) {
@Override
public void containedResourceWithNoId(IParseLocation theLocation) {
if (myLogErrors) {
ourLog.warn("Resource has contained child resource with no ID");
ourLog.warn("{}Resource has contained child resource with no ID", describeLocation(theLocation));
}
}

Expand All @@ -87,8 +87,9 @@ public void incorrectJsonType(
ScalarType theFoundScalarType) {
if (myLogErrors) {
if (ourLog.isWarnEnabled()) {
String message = createIncorrectJsonTypeMessage(
theElementName, theExpected, theExpectedScalarType, theFound, theFoundScalarType);
String message = describeLocation(theLocation) +
createIncorrectJsonTypeMessage(
theElementName, theExpected, theExpectedScalarType, theFound, theFoundScalarType);
ourLog.warn(message);
}
}
Expand Down Expand Up @@ -134,7 +135,7 @@ public boolean isErrorOnInvalidExtension() {
@Override
public void missingRequiredElement(IParseLocation theLocation, String theElementName) {
if (myLogErrors) {
ourLog.warn("Resource is missing required element: {}", theElementName);
ourLog.warn("{}Resource is missing required element: {}", describeLocation(theLocation), theElementName);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
type: add
issue: 5368
title: "Several error messages reported by the LenientErrorHandler (the default parser error handler)
did not include location information in their message. Thanks to Elliot Lavy for the contribution!"
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,11 @@
<name>Mangala Ekanayake</name>
<organization>Cambio</organization>
</developer>
<developer>
<id>elavy-harris</id>
<name>Eliott Lavy</name>
<organization>Harris</organization>
</developer>
</developers>

<licenses>
Expand Down
Loading