Skip to content

Commit

Permalink
Improve error in SimpleJsonResource
Browse files Browse the repository at this point in the history
This will help in debugging #43104
  • Loading branch information
geoand committed Sep 9, 2024
1 parent 47db797 commit d14d163
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 d14d163

Please sign in to comment.