From 1029cb0e2529c62bfef77c1305e9f92e52fef4db Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Sun, 24 Aug 2025 17:49:58 -0400 Subject: [PATCH] Print error messages before command This prevents long commands from hiding the error message --- src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 52fc3ec7..fedeec3a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -322,7 +322,7 @@ export async function run(): Promise { const errMsg = deployCmdExec.stderr || `command exited ${deployCmdExec.exitCode}, but stderr had no output`; - throw new Error(`failed to execute gcloud command \`${commandString}\`: ${errMsg}`); + throw new Error(`failed to deploy: ${errMsg}, full command:\n\t${commandString}`); } setActionOutputs(parseDeployResponse(deployCmdExec.stdout, { tag: tag })); @@ -333,7 +333,7 @@ export async function run(): Promise { const errMsg = updateTrafficExec.stderr || `command exited ${updateTrafficExec.exitCode}, but stderr had no output`; - throw new Error(`failed to execute gcloud command \`${commandString}\`: ${errMsg}`); + throw new Error(`failed to update traffic: ${errMsg}, full command:\n\t${commandString}`); } setActionOutputs(parseUpdateTrafficResponse(updateTrafficExec.stdout)); }