Skip to content

Commit

Permalink
Clarify log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sebr72 committed May 21, 2024
1 parent 3fdf959 commit 84f9bc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ public void setAttributes(final Map<String, Attribute> attributes) {
for (Map.Entry<String, Attribute> entry : attributes.entrySet()) {
Attribute attribute = entry.getValue();
if (attribute == null) {
final String msg =
"Attribute: '" + entry.getKey() + "' is not an attribute. It is a: " + null;
final String msg = "Attribute: '" + entry.getKey() + "' is not a defined attribute.";
LOGGER.error("Error setting the Attributes: {}", msg);
throw new IllegalArgumentException(msg);
} else {
Expand Down
7 changes: 3 additions & 4 deletions core/src/main/java/org/mapfish/print/config/Template.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ public final void setAttributes(final Map<String, Attribute> attributes) {
for (Map.Entry<String, Attribute> entry : attributes.entrySet()) {
Attribute attribute = entry.getValue();
if (attribute == null) {
final String msg =
"Attribute: '" + entry.getKey() + "' is not an attribute. It is a: " + null;
final String msg = "Attribute: '" + entry.getKey() + "' is not a defined attribute";
LOGGER.error("Error setting the Attributes: {}", msg);
throw new IllegalArgumentException(msg);
} else {
Expand Down Expand Up @@ -169,8 +168,8 @@ public final void setProcessors(final List<Processor> processors) {
private void assertProcessors(final List<Processor> processorsToCheck) {
for (Processor entry : processorsToCheck) {
if (entry == null) {
final String msg = "Processor: " + null + " is not a processor.";
LOGGER.error("Error in the processors to check while setting the Attributes: {}", msg);
final String msg = "Processor is missing.";
LOGGER.error("Error in the processors to check while setting the Attributes: {}", msg);
throw new IllegalArgumentException(msg);
}
}
Expand Down

0 comments on commit 84f9bc2

Please sign in to comment.