From 5db0b54368660e7dbfed1e4bbf547247f85c176b Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 26 Jan 2023 12:40:27 +0300 Subject: ActivityPub: log 404 errors on debug level --- src/main/java/com/juick/config/ActivityPubClientErrorHandler.java | 7 +++++-- src/main/java/com/juick/www/api/webfinger/Resource.java | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/main/java') 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; -- cgit v1.2.3