Skip to content

Node.js based forum software built for the modern web

refactor: show stack trace of missing store

Barış Soner Uşaklı19ddee278ddc
diff --git a/src/webserver.js b/src/webserver.js
index b91f3a2dd1..34a9651337 100644
--- a/src/webserver.js
+++ b/src/webserver.js
@@ -41,7 +41,8 @@ app.renderAsync = async (tpl, data) => {
if (!Object.hasOwn(data, '_i18n')) {
const store = als.getStore();
if (!store) {
- winston.warn(`[app.renderAsync] No ALS store found, unable to determine user language for template rendering, using default language instead.`);
+ const stack = new Error().stack.split('\n')[2];
+ winston.warn(`[app.renderAsync] No ALS store found, unable to determine user language for template rendering, using default language instead. Template: ${tpl}\n${stack}`);
}
const uid = store?.uid || 0;
const { userLang, acpLang } = await user.getSettings(uid);