diff options
author | Vitaly Takmazov | 2023-01-26 12:40:27 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-26 13:05:35 +0300 |
commit | 5db0b54368660e7dbfed1e4bbf547247f85c176b (patch) | |
tree | 102f0e1e1aa082cd87f98a611ce095312754187b /src/main | |
parent | 72ee4068bb726a25ec407c1c2ee1ed7b3052f263 (diff) |
ActivityPub: log 404 errors on debug level
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/juick/config/ActivityPubClientErrorHandler.java | 7 | ||||
-rw-r--r-- | src/main/java/com/juick/www/api/webfinger/Resource.java | 3 |
2 files changed, 6 insertions, 4 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; diff --git a/src/main/java/com/juick/www/api/webfinger/Resource.java b/src/main/java/com/juick/www/api/webfinger/Resource.java index 3a6c36c4..4b2bc388 100644 --- a/src/main/java/com/juick/www/api/webfinger/Resource.java +++ b/src/main/java/com/juick/www/api/webfinger/Resource.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2022, Juick + * Copyright (C) 2008-2023, Juick * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -18,7 +18,6 @@ package com.juick.www.api.webfinger; import com.juick.model.User; -import com.juick.www.api.activity.model.Context; import com.juick.www.api.webfinger.model.Account; import com.juick.www.api.webfinger.model.Link; import com.juick.util.HttpNotFoundException; |