From 58f4c171c6b0c8739eeba18fb80e248fb54333bf Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Thu, 9 Oct 2025 22:50:55 -0400 Subject: [PATCH] fix(emcmd): improve error logging for CSRF token retrieval - Updated the error logging in the `readCsrfTokenFromVarIni` function to log the error object directly, enhancing the clarity and detail of the logs when CSRF token retrieval fails. This change improves debugging capabilities by providing more structured error information. --- api/src/core/utils/clients/emcmd.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/core/utils/clients/emcmd.ts b/api/src/core/utils/clients/emcmd.ts index 244065117..30ef0c203 100644 --- a/api/src/core/utils/clients/emcmd.ts +++ b/api/src/core/utils/clients/emcmd.ts @@ -19,7 +19,7 @@ const readCsrfTokenFromVarIni = async (): Promise => { const parsed = ini.parse(iniContents) as { csrf_token?: string }; return parsed?.csrf_token; } catch (error) { - appLogger.debug(`Unable to read CSRF token from ${VAR_INI_PATH}: %o`, error); + appLogger.debug({ error }, `Unable to read CSRF token from ${VAR_INI_PATH}`); return undefined; } };