Skip to content

Commit

Permalink
Merge pull request #43124 from geoand/#43104
Browse files Browse the repository at this point in the history
Improve error in SimpleJsonResource
  • Loading branch information
gsmet authored Sep 9, 2024
2 parents 7a16604 + d14d163 commit 0364ef8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,8 @@ public ObjectWriter apply(ObjectMapper objectMapper, Type type) {
type = ((ParameterizedType) type).getActualTypeArguments()[0];
}
if (!type.getTypeName().equals(Person.class.getName())) {
throw new IllegalArgumentException("Only Person type can be handled");
throw new IllegalArgumentException(
"Type'" + type.getTypeName() + "' cannot be handled. Only 'Person' type is valid");
}
return objectMapper.writer().without(JsonWriteFeature.QUOTE_FIELD_NAMES);
}
Expand Down

0 comments on commit 0364ef8

Please sign in to comment.