diff --git a/extensions/compose/src/compose-extension.ts b/extensions/compose/src/compose-extension.ts index c9c0d4f1e7d..a2dc33c6870 100644 --- a/extensions/compose/src/compose-extension.ts +++ b/extensions/compose/src/compose-extension.ts @@ -116,12 +116,12 @@ export class ComposeExtension { this.statusBarItem.command = statusBarChangesToApply.command; } - this.notifyOnChecks(firstCheck); + await this.notifyOnChecks(firstCheck); } - protected notifyOnChecks(firstCheck: boolean): void { + protected async notifyOnChecks(firstCheck: boolean): Promise { if (this.currentInformation && !firstCheck) { - this.showCurrentInformation(); + await this.showCurrentInformation(); } } @@ -182,10 +182,10 @@ export class ComposeExtension { // make it executable await this.makeExecutable(dockerComposeDownloadLocation); - extensionApi.window.showInformationMessage(`Docker Compose ${selectedRelease.label} installed`); + await extensionApi.window.showInformationMessage(`Docker Compose ${selectedRelease.label} installed`); // update checks - this.runChecks(false); + await this.runChecks(false); } } @@ -215,9 +215,9 @@ export class ComposeExtension { await this.makeExecutable(composeWrapperScript); } - showCurrentInformation(): void { + async showCurrentInformation(): Promise { if (this.currentInformation) { - extensionApi.window.showInformationMessage(this.currentInformation); + await extensionApi.window.showInformationMessage(this.currentInformation); } } diff --git a/extensions/docker/src/extension.ts b/extensions/docker/src/extension.ts index 9e676b64122..91bb510652d 100644 --- a/extensions/docker/src/extension.ts +++ b/extensions/docker/src/extension.ts @@ -87,7 +87,7 @@ async function isDisguisedPodman(socketPath: string): Promise { }); } -async function monitorDaemon(extensionContext: extensionApi.ExtensionContext) { +async function monitorDaemon(extensionContext: extensionApi.ExtensionContext): Promise { // call us again if (!stopLoop) { try { @@ -96,7 +96,9 @@ async function monitorDaemon(extensionContext: extensionApi.ExtensionContext) { // ignore the update of machines } await timeout(5000); - monitorDaemon(extensionContext); + monitorDaemon(extensionContext).catch(err => { + console.error('Error while monitoring docker daemon', err); + }); } } @@ -144,7 +146,9 @@ export async function activate(extensionContext: extensionApi.ExtensionContext): } // monitor daemon - monitorDaemon(extensionContext); + monitorDaemon(extensionContext).catch(err => { + console.error('Error while monitoring docker daemon', err); + }); } function initProvider(extensionContext: extensionApi.ExtensionContext) { diff --git a/extensions/kind/src/image-handler.ts b/extensions/kind/src/image-handler.ts index b9c6c6fcd77..9769d753252 100644 --- a/extensions/kind/src/image-handler.ts +++ b/extensions/kind/src/image-handler.ts @@ -83,12 +83,12 @@ export class ImageHandler { // Show a dialog to the user that the image was pushed // TODO: Change this to taskbar notification when implemented - extensionApi.window.showInformationMessage( + await extensionApi.window.showInformationMessage( `Image ${image.name} pushed to Kind cluster: ${selectedCluster.label}`, ); } catch (err) { // Show a dialog error to the user that the image was not pushed - extensionApi.window.showErrorMessage( + await extensionApi.window.showErrorMessage( `Unable to push image ${image.name} to Kind cluster: ${selectedCluster.label}. Error: ${err}`, ); @@ -97,7 +97,7 @@ export class ImageHandler { } finally { // Remove the temporary file if one was created if (filename !== undefined) { - fs.promises.rm(filename); + await fs.promises.rm(filename); } } }