diff --git a/src/client/common/utils/localize.ts b/src/client/common/utils/localize.ts index 4401cab56176..c7bd51181fd1 100644 --- a/src/client/common/utils/localize.ts +++ b/src/client/common/utils/localize.ts @@ -468,7 +468,9 @@ export namespace CreateEnv { export const recreateDescription = l10n.t('Delete existing ".venv" environment and create a new one'); export const useExisting = l10n.t('Use Existing'); export const useExistingDescription = l10n.t('Use existing ".venv" environment with no changes to it'); - export const existingVenvQuickPickPlaceholder = l10n.t('Use or Recreate existing environment?'); + export const existingVenvQuickPickPlaceholder = l10n.t( + 'Choose an option to handle the existing ".venv" environment', + ); export const deletingEnvironmentProgress = l10n.t('Deleting existing ".venv" environment...'); export const errorDeletingEnvironment = l10n.t('Error while deleting existing ".venv" environment.'); } diff --git a/src/client/pythonEnvironments/creation/provider/condaCreationProvider.ts b/src/client/pythonEnvironments/creation/provider/condaCreationProvider.ts index 74a42808e609..7ca44c1b7eff 100644 --- a/src/client/pythonEnvironments/creation/provider/condaCreationProvider.ts +++ b/src/client/pythonEnvironments/creation/provider/condaCreationProvider.ts @@ -128,7 +128,9 @@ async function createCondaEnv( dispose(); if (proc?.exitCode !== 0) { traceError('Error while running venv creation script: ', progressAndTelemetry.getLastError()); - deferred.reject(progressAndTelemetry.getLastError()); + deferred.reject( + progressAndTelemetry.getLastError() || `Conda env creation failed with exitCode: ${proc?.exitCode}`, + ); } else { deferred.resolve(condaEnvPath); } @@ -249,7 +251,7 @@ async function createEnvironment(options?: CreateEnvironmentOptions): Promise { assert.isDefined(_error); _error!('bad arguments'); _complete!(); - await assert.isRejected(promise); + const result = await promise; + assert.ok(result?.error); assert.isTrue(showErrorMessageWithLogsStub.calledOnce); }); @@ -241,7 +242,8 @@ suite('Conda Creation provider tests', () => { _next!({ out: `${CONDA_ENV_CREATED_MARKER}new_environment`, source: 'stdout' }); _complete!(); - await assert.isRejected(promise); + const result = await promise; + assert.ok(result?.error); assert.isTrue(showErrorMessageWithLogsStub.calledOnce); }); }); diff --git a/src/test/pythonEnvironments/creation/provider/venvCreationProvider.unit.test.ts b/src/test/pythonEnvironments/creation/provider/venvCreationProvider.unit.test.ts index 280d05bf5935..de65887b7edc 100644 --- a/src/test/pythonEnvironments/creation/provider/venvCreationProvider.unit.test.ts +++ b/src/test/pythonEnvironments/creation/provider/venvCreationProvider.unit.test.ts @@ -226,7 +226,8 @@ suite('venv Creation provider tests', () => { assert.isDefined(_error); _error!('bad arguments'); _complete!(); - await assert.isRejected(promise); + const result = await promise; + assert.ok(result?.error); assert.isTrue(showErrorMessageWithLogsStub.calledOnce); assert.isTrue(deleteEnvironmentStub.notCalled); }); @@ -283,7 +284,8 @@ suite('venv Creation provider tests', () => { _next!({ out: `${VENV_CREATED_MARKER}new_environment`, source: 'stdout' }); _complete!(); - await assert.isRejected(promise); + const result = await promise; + assert.ok(result?.error); interpreterQuickPick.verifyAll(); progressMock.verifyAll(); assert.isTrue(showErrorMessageWithLogsStub.calledOnce);