diff --git a/src/backend/logger/logger.ts b/src/backend/logger/logger.ts index fee4455bc4..477cc56a0a 100644 --- a/src/backend/logger/logger.ts +++ b/src/backend/logger/logger.ts @@ -76,6 +76,9 @@ export function initLogger() { forceLog: true }) }) + .catch((error) => + logError(['Failed to fetch system information', error], LogPrefix.Backend) + ) logInfo(['Legendary location:', join(...Object.values(getLegendaryBin()))], { prefix: LogPrefix.Legendary, diff --git a/src/backend/main.ts b/src/backend/main.ts index bb73abb2e1..39e37a492f 100644 --- a/src/backend/main.ts +++ b/src/backend/main.ts @@ -978,7 +978,15 @@ ipcMain.handle( const logFileLocation = getLogFileLocation(appName) - const systemInfo = await getSystemInfo().then(formatSystemInfo) + const systemInfo = await getSystemInfo() + .then(formatSystemInfo) + .catch((error) => { + logError( + ['Failed to fetch system information', error], + LogPrefix.Backend + ) + return 'Error, check general log' + }) writeFileSync(logFileLocation, 'System Info:\n' + `${systemInfo}\n` + '\n') const gameSettingsString = JSON.stringify(gameSettings, null, '\t')