From fff1296d4c59c892657935243c220ee5e87e2cf0 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Fri, 22 Dec 2023 16:13:39 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20ResourceAccessException=E3=82=92SQLExcep?= =?UTF-8?q?tion=E3=81=AB=E3=81=97=E3=81=A6=E5=86=8Dthrow=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/common/AbstractActivityPubProcessor.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/common/AbstractActivityPubProcessor.kt b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/common/AbstractActivityPubProcessor.kt index e26e909d..2ba9d969 100644 --- a/src/main/kotlin/dev/usbharu/hideout/activitypub/service/common/AbstractActivityPubProcessor.kt +++ b/src/main/kotlin/dev/usbharu/hideout/activitypub/service/common/AbstractActivityPubProcessor.kt @@ -5,8 +5,10 @@ import dev.usbharu.hideout.activitypub.domain.exception.FailedProcessException import dev.usbharu.hideout.activitypub.domain.exception.HttpSignatureUnauthorizedException import dev.usbharu.hideout.activitypub.domain.model.objects.Object import dev.usbharu.hideout.application.external.Transaction +import dev.usbharu.hideout.core.domain.exception.resource.ResourceAccessException import org.slf4j.Logger import org.slf4j.LoggerFactory +import java.sql.SQLException abstract class AbstractActivityPubProcessor( private val transaction: Transaction, @@ -21,7 +23,11 @@ abstract class AbstractActivityPubProcessor( logger.info("START ActivityPub process. {}", this.type()) try { transaction.transaction { - internalProcess(activity) + try { + internalProcess(activity) + } catch (e: ResourceAccessException) { + throw SQLException(e) + } } } catch (e: ActivityPubProcessException) { logger.warn("FAILED ActivityPub process", e)