diff --git a/src/vs/code/electron-main/diagnostics.ts b/src/vs/code/electron-main/diagnostics.ts index e993b920c02b6edbecb8205330d3b1bc565427b9..ce7c148638bb54df305f6c96508598695af8b0e2 100644 --- a/src/vs/code/electron-main/diagnostics.ts +++ b/src/vs/code/electron-main/diagnostics.ts @@ -42,17 +42,16 @@ export function printDiagnostics(info: IMainProcessInfo): Promise { window.folders.forEach(folder => { console.log(`| Folder (${basename(folder)})`); - let stats: WorkspaceStats; try { - stats = collectWorkspaceStats(folder, ['node_modules', '.git']); + const stats = collectWorkspaceStats(folder, ['node_modules', '.git']); console.log(formatWorkspaceStats(stats)); - } catch (error) { - console.log('Unable to collect workpsace stats for this folder'); - } - const launchConfigs = collectLaunchConfigs(folder); - if (launchConfigs.length > 0) { - console.log(formatLaunchConfigs(launchConfigs)); + const launchConfigs = collectLaunchConfigs(folder); + if (launchConfigs.length > 0) { + console.log(formatLaunchConfigs(launchConfigs)); + } + } catch (error) { + console.log(`| Error: Unable to collect workpsace stats for this folder (${error.toString()})`); } }); });