Fix import + throw error

This commit is contained in:
shati-patel
2022-01-17 20:20:27 +00:00
committed by Shati Patel
parent c90659fd92
commit a5bc25e211
2 changed files with 3 additions and 4 deletions

View File

@@ -3,7 +3,6 @@ import {
getOnDiskWorkspaceFolders,
showAndLogErrorMessage,
showAndLogInformationMessage,
showAndLogWarningMessage,
} from './helpers';
import { QuickPickItem, window } from 'vscode';
import { ProgressCallback, UserCancellationException } from './commandRunner';
@@ -123,8 +122,8 @@ export async function handleInstallPacks(
}
if (failedPacks.length > 0) {
void logger.log(`Errors:\n${errors.join('\n')}`);
void showAndLogWarningMessage(
`Unable to install some packs: ${failedPacks.join(', ')}. See logs for more details.`
throw new Error(
`Unable to install packs: ${failedPacks.join(', ')}. See logs for more details.`
);
} else {
void showAndLogInformationMessage('Finished installing packs.');

View File

@@ -47,7 +47,7 @@ describe('Packaging commands', function() {
showAndLogErrorMessageSpy = sandbox.stub();
showAndLogInformationMessageSpy = sandbox.stub();
mod = proxyquire('../../packaging', {
'../helpers': {
'./helpers': {
showAndLogErrorMessage: showAndLogErrorMessageSpy,
showAndLogInformationMessage: showAndLogInformationMessageSpy,
},