From 450322d12f1b59febfd0f7850abdd99813785df0 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 9 Jan 2025 11:17:53 -0500 Subject: [PATCH] fix: handle ap send errors with object body --- src/activitypub/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/activitypub/index.js b/src/activitypub/index.js index 8a254a78f4..2043f127a6 100644 --- a/src/activitypub/index.js +++ b/src/activitypub/index.js @@ -336,6 +336,9 @@ async function sendMessage(uri, id, type, payload, attempts = 1) { if (String(response.statusCode).startsWith('2')) { ActivityPub.helpers.log(`[activitypub/send] Successfully sent ${payload.type} to ${uri}`); } else { + if (typeof body === 'object') { + throw new Error(JSON.stringify(body)); + } throw new Error(String(body)); } } catch (e) {