In continuation of my adventures with `local.Comma...
# general
In continuation of my adventures with
), I’m seeing some odd behavior in regards to
when the command itself fails. Specifically, if my command script fails (exits with a non-zero code), I get this reported on my status:
Copy code
  command:local:Command (my-script):
    error: exit status 1

  pulumi:pulumi:Stack (mystack-dev):
    error: update failed
is never set. Specifically, I’ve tried the following:
Copy code
ctx.Export("stdout", cmd.Stdout)
	ctx.Export("stderr", cmd.Stderr)

	pulumi.All(cmd.Stdout, cmd.Stderr).ApplyT(func(args []interface{}) string {
		stdout := args[0].(string)
		stderr := args[1].(string)

		fmt.Println("stdout", stdout)
		fmt.Println("stderr", stderr)

		return ""
But none of this prints out. I also tried just stdout and stderr individually, and no dice. If, however, the command exits successfully (with a zero error code), then stdout/stderr complete successfully. My main use case is one of debugging - I want to know why my script fails and that information exists in
, but I cannot access it in the case I need it, which is when it fails 🙂 Am I doing something wrong?
OK I see, and looking at the code, looks like this is expected behavior at the moment.
At the moment, yes, the command provider is still in preview, so there are a few more things to address than in other generally available providers. I see you've already voted for the issue and commented; thanks for giving us more information!
Thanks Laura.
👍 1