aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/config
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-01-26 12:40:27 +0300
committerGravatar Vitaly Takmazov2023-01-26 13:05:35 +0300
commit5db0b54368660e7dbfed1e4bbf547247f85c176b (patch)
tree102f0e1e1aa082cd87f98a611ce095312754187b /src/main/java/com/juick/config
parent72ee4068bb726a25ec407c1c2ee1ed7b3052f263 (diff)
ActivityPub: log 404 errors on debug level
Diffstat (limited to 'src/main/java/com/juick/config')
-rw-r--r--src/main/java/com/juick/config/ActivityPubClientErrorHandler.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/com/juick/config/ActivityPubClientErrorHandler.java b/src/main/java/com/juick/config/ActivityPubClientErrorHandler.java
index c6e59768..f230d3d7 100644
--- a/src/main/java/com/juick/config/ActivityPubClientErrorHandler.java
+++ b/src/main/java/com/juick/config/ActivityPubClientErrorHandler.java
@@ -43,12 +43,15 @@ public class ActivityPubClientErrorHandler implements Interceptor {
var response = chain.proceed(request);
var url = request.url();
if (!response.isSuccessful()) {
+ var code = response.code();
+ var body = response.body() != null ? response.body().string() : "";
if (response.code() == HttpStatus.GONE.value()) {
logger.debug("Server report {} is gone, deleting", url);
applicationEventPublisher.publishEvent(new DeleteUserEvent(this, url.toString()));
+ } else if (response.code() == HttpStatus.NOT_FOUND.value()) {
+ logger.debug("HTTP ERROR {} on {} : {}", code, url, body);
} else {
- logger.warn("HTTP ERROR {} on {} : {}", response.code(),
- url, response.body() != null ? response.body().string() : "");
+ logger.warn("HTTP ERROR {} on {} : {}", code, url, body);
}
}
return response;