Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
progress.report({
increment: 100 / totalUpdates
});
}
} catch (error) {
progress.report({
message: `Failed to install ${label} (${counter}/${totalUpdates})`
});
if (incrementProgress) {
progress.report({
increment: 100 / totalUpdates
});
}
if (error.metadata) {
const { metadata } = error;
if (update.productName === updates.ProductNames.AppcInstaller && metadata.errorCode === 'EACCES') {
const runWithSudo = await vscode.window.showErrorMessage(`Failed to update to ${label} as it must be ran with sudo`, {
title: 'Install with Sudo',
run: () => {
ExtensionContainer.terminal.executeCommand(`sudo ${metadata.command}`);
}
});
if (runWithSudo) {
runWithSudo.run();
}
}
} else {
// TODO should we show the error that we got passed?
await vscode.window.showErrorMessage(`Failed to update to ${label}`);
}
}
counter++;