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.
This commit is contained in:
Eli Bosley
2025-10-09 22:50:55 -04:00
parent 803824c9a7
commit 58f4c171c6
+1 -1
View File
@@ -19,7 +19,7 @@ const readCsrfTokenFromVarIni = async (): Promise<string | undefined> => {
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;
}
};