mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15:46 +01:00
fix: handle ap send errors with object body
This commit is contained in:
@@ -336,6 +336,9 @@ async function sendMessage(uri, id, type, payload, attempts = 1) {
|
|||||||
if (String(response.statusCode).startsWith('2')) {
|
if (String(response.statusCode).startsWith('2')) {
|
||||||
ActivityPub.helpers.log(`[activitypub/send] Successfully sent ${payload.type} to ${uri}`);
|
ActivityPub.helpers.log(`[activitypub/send] Successfully sent ${payload.type} to ${uri}`);
|
||||||
} else {
|
} else {
|
||||||
|
if (typeof body === 'object') {
|
||||||
|
throw new Error(JSON.stringify(body));
|
||||||
|
}
|
||||||
throw new Error(String(body));
|
throw new Error(String(body));
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user