aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-01-04 22:40:28 +0300
committerGravatar Vitaly Takmazov2023-01-04 22:40:28 +0300
commit9aee05354c68e2bb336ccc8e67b2c36ede41c997 (patch)
tree10890a3d989a5bf41340f41f89cb9adb3c3814f1
parente17ac99c67e5069745f3f19a91c18b6d3288b6e9 (diff)
ActivityPub: better logging
-rw-r--r--src/main/java/com/juick/config/ActivityPubClientErrorHandler.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main/java/com/juick/config/ActivityPubClientErrorHandler.java b/src/main/java/com/juick/config/ActivityPubClientErrorHandler.java
index 23576ad5..243a4e32 100644
--- a/src/main/java/com/juick/config/ActivityPubClientErrorHandler.java
+++ b/src/main/java/com/juick/config/ActivityPubClientErrorHandler.java
@@ -28,11 +28,9 @@ import org.springframework.http.client.ClientHttpResponse;
import org.springframework.stereotype.Component;
import org.springframework.web.client.DefaultResponseErrorHandler;
-import javax.annotation.Nonnull;
import javax.inject.Inject;
import java.io.IOException;
import java.net.URI;
-import java.nio.charset.StandardCharsets;
@Component
public class ActivityPubClientErrorHandler extends DefaultResponseErrorHandler {
@@ -40,14 +38,14 @@ public class ActivityPubClientErrorHandler extends DefaultResponseErrorHandler {
@Inject
private ApplicationEventPublisher applicationEventPublisher;
@Override
- public void handleError(@Nonnull URI contextUri, @Nonnull HttpMethod method, ClientHttpResponse response)
+ public void handleError(URI contextUri, HttpMethod method, ClientHttpResponse response)
throws IOException {
if (response.getStatusCode().equals(HttpStatus.GONE)) {
logger.warn("Server report {} is gone, deleting", contextUri.toASCIIString());
applicationEventPublisher.publishEvent(new DeleteUserEvent(this, contextUri.toASCIIString()));
} else {
- logger.warn("HTTP ERROR {} {} : {}", response.getStatusCode().value(),
- response.getStatusText(), IOUtils.toString(response.getBody(), StandardCharsets.UTF_8));
+ logger.warn("HTTP ERROR {} on {} : {}", response.getStatusCode().value(),
+ contextUri.toASCIIString(), response.getStatusText());
}
}
}