https://pulumi.com logo
#python
Title
# python
a

astonishing-branch-30086

04/01/2021, 9:31 AM
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!
b

brave-knife-93369

04/01/2021, 10:02 AM
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")
)
a

astonishing-branch-30086

04/01/2021, 1:33 PM
Thanks @brave-knife-93369, this seems to work well indeed!
🙌 1