pulumi/pkg/backend/diy
Will Jones 1be4888f7d
Replace `result.Result` with native errors (#17044)
`result.Result` is a type that was introduced to enable us to
distinguish between *expected* errors (or *bails* in Pulumi parlance)
and *unexpected* errors or exceptions. Prior to Go 1.13, this made a lot
of sense, since there was no standard story on "wrapping" errors, and
thus no way to answer the question "did I end up here (in an error path)
because I meant to, or did I end up here because of a program bug?".

With the introduction of `%w`, `interface { Unwrap() []error }` and
company in Go 1.13, a simpler interface is available: one can use
`errors.Is` and `errors.As` to ask if an error at any point wraps an
error of a certain type. With this, we can simply ask "is there a bail
at any point in this error tree?" rather than having to track this
explicitly using a type such as `result.Result`. The `IsBail` function
was introduced a while ago to this end, but its rollout was not
completed and several uses of `result.Result` remained.

This commit completes the rollout of this simplified interface,
replacing all uses of `result.Result` with native Go errors that may or
may not wrap bails, and all uses of e.g. `res.IsBail` with
`IsBail(err)`. Doing so allows us to remove `result.Result` entirely.
2024-08-22 14:39:59 +00:00
..
backend.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
backend_legacy_test.go Lift context parameter to SerializeDeployment/Resource/Operations/Properties (#15929) 2024-04-15 07:45:46 +00:00
backend_test.go Rewrite `DeletedWith` properties when renaming stacks (#16216) 2024-05-16 15:09:32 +00:00
bucket.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
bucket_test.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
doc.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
lock.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
meta.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
meta_test.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
pool.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
pool_test.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
snapshot.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
stack.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
state.go Always use the snapshot secret manager (#15768) 2024-03-25 10:30:14 +00:00
store.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00
store_test.go Rename filestate to DIY (#15314) 2024-01-30 15:53:10 +00:00