Skip to content

Commit 27293e8

Browse files
authored
delete the downloaded cached vsix before throwing error (microsoft#199673)
1 parent 72f9748 commit 27293e8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/vs/platform/extensionManagement/node/extensionDownloader.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ export class ExtensionsDownloader extends Disposable {
6868
this.logService.trace(`Extension signature verification details for ${extension.identifier.id} ${extension.version}:\n${sigError.output}`);
6969
}
7070
if (verificationStatus === ExtensionSignaturetErrorCode.PackageIsInvalidZip || verificationStatus === ExtensionSignaturetErrorCode.SignatureArchiveIsInvalidZip) {
71+
try {
72+
// Delete the downloaded vsix before throwing the error
73+
await this.delete(location);
74+
} catch (error) {
75+
this.logService.error(error);
76+
}
7177
throw new ExtensionManagementError(CorruptZipMessage, ExtensionManagementErrorCode.CorruptZip);
7278
}
7379
} finally {

0 commit comments

Comments
 (0)