Why the `ApplyX` methods doesn’t return an error? ...
# golang
c
Why the
ApplyX
methods doesn’t return an error? What if I need to to some manipulation that can result in an error (e.g marshal a json)
l
How would you want this to work? Apply returns an output (like a promise), so any error value returned would also have to be an output. The work doesn't happen immediately so I'm not sure it would be useful in a traditional go error handling context.
c
I understand that but I’d expect that the callback for the apply should also return an error to indicate the transformation has failed somehow - and fail the entire deployment
l
Some forms of apply are explicit about allowing errors in the callback: https://github.com/pulumi/pulumi/blob/b4452061014da5bae9ed79c6243acd70c92e2972/sdk/go/pulumi/types.go#L303 I'm not certain, but I believe you can return an error in
ApplyX
methods.
c
I see, I’ll give it a try
The lack of generics in go is always effecting me 😄
l
Yeah, it's unfortunate. It's on my eventual todo to try and play around with pulumi and the generics proposal.