https://pulumi.com logo
#golang
Title
# golang
g

gorgeous-architect-28903

11/28/2023, 1:09 PM
Anyone have experience with error handling for Stack References? I have a situation where I want to read outputs of another stack, but it may not exist yet. It seems like in that situation, Pulumi is canceling the context and I never have a chance to handle the error gracefully, e.g.:
Copy code
ref, err := pulumi.NewStackReference(ctx, stack, nil)
if err != nil {
    fmt.Println("never make it here")
    return errors.Join(ErrStackNotFound, err)
}
e

echoing-dinner-19531

11/28/2023, 10:32 PM
This is basically another case of https://github.com/pulumi/pulumi/issues/3364.
g

gorgeous-architect-28903

11/29/2023, 11:12 AM
Ah, true. Thanks. Didn’t connect the dots there somehow. Stack references don’t “feel” like resources.
3 Views