Skip to content

Node.js based forum software built for the modern web

fix: catch thrown errors in ap helpers._test

Julian Lam906ca0440faf
diff --git a/src/activitypub/helpers.js b/src/activitypub/helpers.js
index d06a058201..5dff8c0b00 100644
--- a/src/activitypub/helpers.js
+++ b/src/activitypub/helpers.js
@@ -33,7 +33,11 @@ Helpers._webfingerCache = webfingerCache; // exported for tests
Helpers._test = (method, args) => {
// because I am lazy and I probably wrote some variant of this below code 1000 times already
setTimeout(async () => {
- console.log(await method.apply(method, args));
+ try {
+ console.log(await method.apply(method, args));
+ } catch (e) {
+ console.log('Exception thrown', e);
+ }
}, 2500);
};
// process.nextTick(() => {