pulumi/pkg/backend/httpstate
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
..
client Fix deployment settings serialization and keys consistency (#16904) 2024-08-12 19:28:13 +00:00
testdata [snapshot] Use a newer diff package 2023-05-16 12:33:30 -07:00
backend.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
backend_test.go Support always qualifying stack names (#11081) (#15857) 2024-04-04 10:11:46 +00:00
console.go Add support for a PULUMI_CONSOLE_DOMAIN env var (#4410) 2020-04-17 11:50:00 -07:00
console_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
diffs.go Clean up uses of .Error() (#14965) 2023-12-20 15:54:06 +00:00
diffs_post_1.20.go Clean up uses of .Error() (#14965) 2023-12-20 15:54:06 +00:00
diffs_pre_1.20.go [snapshot] Use a newer diff package 2023-05-16 12:33:30 -07:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
environments.go [cli] Include config from ESC in `pulumi config` (#14560) 2023-11-21 10:44:45 +00:00
mock.go Update pu/pu to support deployment run command (#16492) 2024-07-01 14:18:44 +00:00
policypack.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
snapshot.go Lift context parameter to SerializeDeployment/Resource/Operations/Properties (#15929) 2024-04-15 07:45:46 +00:00
snapshot_test.go Add display to the engine tests (#16050) 2024-05-13 07:18:25 +00:00
stack.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
state.go Run integration tests with race detection (#15895) 2024-04-11 15:58:42 +00:00
token_source.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
token_source_test.go Skip TestTokenSourceWithQuicklyExpiringInitialToken (#16515) 2024-06-28 07:42:46 +00:00