anyone here know the best way to do a test in TS f...
# python
e
anyone here know the best way to do a test in TS for if a resource exists? eg
Copy code
password = pulumi.output(aws.secretsmanager.getSecret({
          name: `testSecret`,
        },
spits out a unhandled exception. I’d like to capture this nicely and exit and not explode the program. First attempt using try/catch didn’t stop it from exploding
g
Unfortunately there's not a way to catch these errors at the moment. Allowing for this is being tracked in https://github.com/pulumi/pulumi/issues/3364.
As a workaround until that is complete, you could use the aws sdk to do the lookup instead and handle the "not found" error from it.
e
Ah! Thanks for the heads up. I was doing the lookups in testing but may need to pass those through!