Skip to content

Commit

Permalink
Better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Aug 5, 2021
1 parent 2a43b29 commit fda25f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,8 @@ && isContextType(paramType.asClassType())) {
} else if (!field && pathParameters.contains(sourceName)) {
builder.setName(sourceName);
builder.setType(ParameterType.PATH);
builder.setErrorLocation(builder.getErrorLocation()
+ " (this parameter name matches the @Path parameter name, so it has been implicitly assumed to be an @PathParam and not the request body)");
convertible = true;
} else {
//un-annotated field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,13 @@ elementType, toClassName(paramType, currentClassInfo, actualEndpointInfo, index)

protected void handleOtherParam(Map<String, String> existingConverters, String errorLocation, boolean hasRuntimeConverters,
ServerIndexedParameter builder, String elementType) {
builder.setConverter(extractConverter(elementType, index,
existingConverters, errorLocation, hasRuntimeConverters));
try {
builder.setConverter(extractConverter(elementType, index,
existingConverters, errorLocation, hasRuntimeConverters));
} catch (Throwable throwable) {
throw new RuntimeException("Could not create converter for " + elementType + " for " + builder.getErrorLocation()
+ " of type " + builder.getType());
}
}

protected void handleSortedSetParam(Map<String, String> existingConverters, String errorLocation,
Expand Down

0 comments on commit fda25f6

Please sign in to comment.