fix: don't crash if there are exceptions in action hooks

since some action hooks are called without an await
This commit is contained in:
Barış Soner Uşaklı
2025-02-28 11:10:31 -05:00
parent 3292a85820
commit 30068245d3

View File

@@ -275,8 +275,12 @@ async function fireActionHook(hook, hookList, params) {
winston.warn(`[plugins] Expected method for hook '${hook}' in plugin '${hookObj.id}' not found, skipping.`);
}
} else {
// eslint-disable-next-line
await hookObj.method(params);
try {
// eslint-disable-next-line
await hookObj.method(params);
} catch (err) {
winston.error(`[plugins] Error in hook ${hookObj.id}@${hookObj.hook} \n${err.stack}`);
}
}
}
}