kwin commented on code in PR #2326:
URL: https://github.com/apache/maven-resolver/pull/2326#discussion_r4611888956
##########
maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/http/RFC9457/RFC9457Reporter.java:
##########
@@ -133,12 +202,43 @@ public void generateException(T response,
BiConsumerChecked<Integer, String, E>
}
if (rfc9457Payload != null) {
throw new HttpRFC9457Exception(statusCode, reasonPhrase,
rfc9457Payload);
+ } else {
+ throw new HttpTransporterException(
+ statusCode, reasonPhrase,
generateBodyExtract(body, contentType));
}
- baseException.accept(statusCode, reasonPhrase);
- return;
+ } else {
+ // No body found but it is representing a RFC 9457 message due
to the content type.
+ throw new HttpRFC9457Exception(statusCode, reasonPhrase,
RFC9457Payload.INSTANCE);
}
- throw new HttpRFC9457Exception(statusCode, reasonPhrase,
RFC9457Payload.INSTANCE);
+ } else {
+ try {
+ body = getBody(response);
Review Comment:
Tracked separately in https://github.com/apache/maven-resolver/issues/2332
as this does not only affect error handling but also success responses.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]