Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/managers/builtin/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ export async function runUV(
reject(new CancellationError());
});

proc.on('error', (err) => {
log?.error(`Error spawning uv: ${err}`);
reject(new Error(`Error spawning uv: ${err.message}`));
});

let builder = '';
proc.stdout?.on('data', (data) => {
const s = data.toString('utf-8');
Expand Down Expand Up @@ -72,6 +77,12 @@ export async function runPython(
proc.kill();
reject(new CancellationError());
});

proc.on('error', (err) => {
log?.error(`Error spawning python: ${err}`);
reject(new Error(`Error spawning python: ${err.message}`));
});

let builder = '';
proc.stdout?.on('data', (data) => {
const s = data.toString('utf-8');
Expand Down
5 changes: 5 additions & 0 deletions src/managers/builtin/venvManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ export class VenvManager implements EnvironmentManager {
}`,
);
}
} else if (result?.envCreationErr) {
// Show error message to user when environment creation failed
showErrorMessage(
l10n.t('Failed to create virtual environment: {0}', result.envCreationErr),
);
}
return result?.environment ?? undefined;
} finally {
Expand Down
3 changes: 3 additions & 0 deletions src/managers/conda/condaEnvManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ export class CondaEnvManager implements EnvironmentManager, Disposable {
return result;
} catch (error) {
this.log.error('Failed to create conda environment:', error);
showErrorMessage(
l10n.t('Failed to create conda environment: {0}', error instanceof Error ? error.message : String(error)),
);
return undefined;
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/managers/conda/condaUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ async function _runConda(
deferred.reject(new CancellationError());
});

proc.on('error', (err) => {
log?.error(`Error spawning conda: ${err}`);
deferred.reject(new Error(`Error spawning conda: ${err.message}`));
});

let stdout = '';
let stderr = '';
proc.stdout?.on('data', (data) => {
Expand Down
Loading