https://pulumi.com logo
#general
Title
# general
w

wet-noon-14291

01/12/2022, 8:22 AM
When I have an error in pulumi, is there an easy way to extract the error message (using typescript)? The error I get from pulumi has the following structure:
Copy code
{
  "commandResult": {
    "stdout": "....",
    "stderr": "....",
    "code": 255
  },
  "name": "CommandError"
}
where my internal error message is in the
stdout
property as part of a long string. I can use regex on the string, but it should be an easier way as I see it. This isn't an issue when you are running from the CLI, but it is more an issue when you are using automation so you can provide better error messages to the users.