mirror of
https://github.com/unraid/api.git
synced 2026-05-11 18:24:06 -05:00
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:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user