feat: log config recreation reason

This commit is contained in:
Eli Bosley
2023-12-13 12:47:40 -05:00
parent 2aacbc1f1a
commit 127e2c3be6
2 changed files with 2 additions and 3 deletions

View File

@@ -105,11 +105,10 @@ void am(
},
async (error: NodeJS.ErrnoException) => {
logger.error('API-GLOBAL-ERROR %s %s', error.message, error.stack);
shutdownApiEvent();
if (server) {
await server?.close?.();
}
shutdownApiEvent();
// Kill application
process.exitCode = 1;
}

View File

@@ -197,7 +197,7 @@ export const loadConfigFile = createAsyncThunk<
}
return newConfigFile;
} catch (error: unknown) {
logger.warn('Config file is corrupted, recreating config', error);
logger.warn('Config file is corrupted with error: %o - recreating config', error);
const config = getWriteableConfig(initialState, 'flash');
const newConfig = generateApiKeysIfNotExistent(config);
newConfig.remote.wanaccess = 'no';