Skip to content

Commit 7a16d12

Browse files
authored
Print error messages before command (#573)
This prevents long commands from hiding the error message Fixes #569
1 parent 098dfb3 commit 7a16d12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ export async function run(): Promise<void> {
322322
const errMsg =
323323
deployCmdExec.stderr ||
324324
`command exited ${deployCmdExec.exitCode}, but stderr had no output`;
325-
throw new Error(`failed to execute gcloud command \`${commandString}\`: ${errMsg}`);
325+
throw new Error(`failed to deploy: ${errMsg}, full command:\n\t${commandString}`);
326326
}
327327
setActionOutputs(parseDeployResponse(deployCmdExec.stdout, { tag: tag }));
328328

@@ -333,7 +333,7 @@ export async function run(): Promise<void> {
333333
const errMsg =
334334
updateTrafficExec.stderr ||
335335
`command exited ${updateTrafficExec.exitCode}, but stderr had no output`;
336-
throw new Error(`failed to execute gcloud command \`${commandString}\`: ${errMsg}`);
336+
throw new Error(`failed to update traffic: ${errMsg}, full command:\n\t${commandString}`);
337337
}
338338
setActionOutputs(parseUpdateTrafficResponse(updateTrafficExec.stdout));
339339
}

0 commit comments

Comments
 (0)