What is the correct failure status/exception to re...
# python
What is the correct failure status/exception to return when a CRUD operation in a dynamic resource provider fails? I'm following the example here to build a dynamic resource provider in Python. The create() operation of my resource can fail as there a lot of status checks are involved. What status or exception should I return to get a clean failure status in the
pulumi up
output? In the best case I want to see a message that explains the reason of failure. Thanks!
Simply letting Exceptions bubble up outside of your provider will display an error string witht eh exception's message. I don't know if that's the "correct" way but at least it works
(to be clear, just e.g.
raise Exception("Some information")
Thanks @brave-knife-93369, this seems to work well indeed!
🙌 1