elharo commented on code in PR #1955:
URL: https://github.com/apache/maven-resolver/pull/1955#discussion_r3570641298
##########
maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/http/RFC9457/RFC9457Reporter.java:
##########
@@ -92,6 +97,15 @@ public void generateException(T response,
BiConsumerChecked<Integer, String, E>
throw new HttpRFC9457Exception(statusCode, reasonPhrase,
rfc9457Payload);
}
throw new HttpRFC9457Exception(statusCode, reasonPhrase,
RFC9457Payload.INSTANCE);
+ } else {
+ try {
+ LOGGER.debug(
+ "Received a response (not RFC 9457 compliant) with
status code {}: {}",
+ statusCode,
+ getBody(response));
+ } catch (IOException e) {
+ throw new UncheckedIOException("Failed to read response body",
e);
Review Comment:
probably no0t worth throwing this at all if it just means we couldn't log a
debug message
##########
maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/http/RFC9457/RFC9457Reporter.java:
##########
@@ -92,6 +97,15 @@ public void generateException(T response,
BiConsumerChecked<Integer, String, E>
throw new HttpRFC9457Exception(statusCode, reasonPhrase,
rfc9457Payload);
}
throw new HttpRFC9457Exception(statusCode, reasonPhrase,
RFC9457Payload.INSTANCE);
+ } else {
Review Comment:
Per the Javadoc comment above this is incorrect. baseException should be
thrown. I'm not sure if this should be fixed or if the doc needs to be changed,
but they should be consistent
##########
maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/http/RFC9457/RFC9457Reporter.java:
##########
@@ -92,6 +97,15 @@ public void generateException(T response,
BiConsumerChecked<Integer, String, E>
throw new HttpRFC9457Exception(statusCode, reasonPhrase,
rfc9457Payload);
}
throw new HttpRFC9457Exception(statusCode, reasonPhrase,
RFC9457Payload.INSTANCE);
+ } else {
+ try {
+ LOGGER.debug(
+ "Received a response (not RFC 9457 compliant) with
status code {}: {}",
+ statusCode,
+ getBody(response));
+ } catch (IOException e) {
+ throw new UncheckedIOException("Failed to read response body",
e);
Review Comment:
probably not worth throwing this at all if it just means we couldn't log a
debug message
--
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]