if err != nil {
return errors.Wrapf(err, "message with error context goes here")
}
It is not bad and I usually can track down any error. But I must say I don't like it.
s
some-grass-63999
01/26/2023, 12:04 AM
so you can track it by using that message you provide?
g
gifted-fall-44000
01/26/2023, 1:21 AM
You have many options here and if you don't provide addition context when encountering an error I understand how that feels hard. I typically write a func to handle errors generally. Use ctx.Log.Error(err.Error()) with some nice text to help yourself. Golang is the choice here introducing this friction as it forces you to handle your errors. Here is no exception, I really prefer this honestly. If there is an error you want it to fail fast just call os.Exit(1) to stop before.moving further.
p
purple-coat-73595
01/26/2023, 5:17 PM
@some-grass-63999 The message yes, but there is something better. Try this:
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.