mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 23:40:38 +01:00
fix: only log warning on ap.send failure
This commit is contained in:
@@ -223,6 +223,7 @@ ActivityPub.send = async (type, id, targets, payload) => {
|
|||||||
const keyData = await ActivityPub.getPrivateKey(type, id);
|
const keyData = await ActivityPub.getPrivateKey(type, id);
|
||||||
const headers = await ActivityPub.sign(keyData, uri, payload);
|
const headers = await ActivityPub.sign(keyData, uri, payload);
|
||||||
winston.verbose(`[activitypub/send] ${uri}`);
|
winston.verbose(`[activitypub/send] ${uri}`);
|
||||||
|
try {
|
||||||
const { response, body } = await request.post(uri, {
|
const { response, body } = await request.post(uri, {
|
||||||
headers: {
|
headers: {
|
||||||
...headers,
|
...headers,
|
||||||
@@ -236,5 +237,8 @@ ActivityPub.send = async (type, id, targets, payload) => {
|
|||||||
} else {
|
} else {
|
||||||
winston.warn(`[activitypub/send] Could not send ${payload.type} to ${uri}; error: ${body}`);
|
winston.warn(`[activitypub/send] Could not send ${payload.type} to ${uri}; error: ${body}`);
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
winston.warn(`[activitypub/send] Could not send ${payload.type} to ${uri}; error: ${e.message}`);
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user