mirror of
https://github.com/usbharu/Hideout.git
synced 2026-09-26 06:51:09 +00:00
feat: JSONのデシリアライズに失敗したときログを出すように
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package dev.usbharu.hideout.activitypub.service.inbox
|
package dev.usbharu.hideout.activitypub.service.inbox
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonParseException
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper
|
import com.fasterxml.jackson.databind.ObjectMapper
|
||||||
import com.fasterxml.jackson.module.kotlin.readValue
|
import com.fasterxml.jackson.module.kotlin.readValue
|
||||||
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
|
import dev.usbharu.hideout.activitypub.domain.model.objects.Object
|
||||||
@@ -119,7 +120,12 @@ class InboxJobProcessor(
|
|||||||
throw IllegalStateException("ActivityPubProcessor not found. type: ${param.type}")
|
throw IllegalStateException("ActivityPubProcessor not found. type: ${param.type}")
|
||||||
}
|
}
|
||||||
|
|
||||||
val value = objectMapper.treeToValue(jsonNode, activityPubProcessor.type())
|
val value = try {
|
||||||
|
objectMapper.treeToValue(jsonNode, activityPubProcessor.type())
|
||||||
|
} catch (e: JsonParseException) {
|
||||||
|
logger.warn("Invalid JSON\n\n{}\n\n", jsonNode.toPrettyString())
|
||||||
|
throw e
|
||||||
|
}
|
||||||
activityPubProcessor.process(ActivityPubProcessContext(value, jsonNode, httpRequest, signature, verify))
|
activityPubProcessor.process(ActivityPubProcessContext(value, jsonNode, httpRequest, signature, verify))
|
||||||
|
|
||||||
logger.info("SUCCESS Process inbox. type: {}", param.type)
|
logger.info("SUCCESS Process inbox. type: {}", param.type)
|
||||||
|
|||||||
Reference in New Issue
Block a user