fix(process-utils): fix bug that prevented start-up when running process walking command fails (#7757)

This commit is contained in:
Shreya Keshive
2025-09-04 16:10:33 -07:00
committed by mkorwel
parent 9e574773c9
commit ad3bc17e45

View File

@@ -24,6 +24,7 @@ async function getProcessInfo(pid: number): Promise<{
name: string; name: string;
command: string; command: string;
}> { }> {
try {
const platform = os.platform(); const platform = os.platform();
if (platform === 'win32') { if (platform === 'win32') {
const powershellCommand = [ const powershellCommand = [
@@ -58,6 +59,10 @@ async function getProcessInfo(pid: number): Promise<{
command: fullCommand, command: fullCommand,
}; };
} }
} catch (_e) {
console.debug(`Failed to get process info for pid ${pid}:`, _e);
return { parentPid: 0, name: '', command: '' };
}
} }
/** /**
@@ -169,7 +174,6 @@ async function getIdeProcessInfoForWindows(): Promise<{
* top-level ancestor process ID and command as a fallback. * top-level ancestor process ID and command as a fallback.
* *
* @returns A promise that resolves to the PID and command of the IDE process. * @returns A promise that resolves to the PID and command of the IDE process.
* @throws Will throw an error if the underlying shell commands fail.
*/ */
export async function getIdeProcessInfo(): Promise<{ export async function getIdeProcessInfo(): Promise<{
pid: number; pid: number;