From 96a27e5a8cdd4a8ce793478b9e54fbc4d1ecc239 Mon Sep 17 00:00:00 2001 From: Joe Hanley Date: Wed, 20 Nov 2024 09:40:09 -0800 Subject: [PATCH] Emulators:exec should rethrow errors from emulator startup --- CHANGELOG.md | 1 + src/emulator/commandUtils.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29bb2d..2e5d0f1d5fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1 @@ +- Fixes an issue where `emulators:exec` would return a 0 error code when emulators failed to start. (#7974) diff --git a/src/emulator/commandUtils.ts b/src/emulator/commandUtils.ts index a825a030b74..119bc509f13 100644 --- a/src/emulator/commandUtils.ts +++ b/src/emulator/commandUtils.ts @@ -468,8 +468,9 @@ export async function emulatorExec(script: string, options: any): Promise await sendVSCodeMessage({ message: VSCODE_MESSAGE.EMULATORS_STARTED }); exitCode = await runScript(script, extraEnv); await controller.onExit(options); - } catch { + } catch (err: unknown) { await sendVSCodeMessage({ message: VSCODE_MESSAGE.EMULATORS_START_ERRORED }); + throw err; } finally { await controller.cleanShutdown(); }