New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error message for invalid enum values on pulumi convert
#11019
Conversation
Changelog[uncommitted] (2022-12-01)Bug Fixes
|
type
pulumi convert
Instead of panicking, can we emit the raw value ( |
I think the simplest solution would be to call |
cd4a7ef
to
5cb5aba
Compare
...g/20221201--programgen--improve-error-message-for-invalid-enum-values-on-pulumi-convert.yaml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some nits left, but it looks good otherwise. LGTM!
(Conditional on 🟢 tests of course)
bors merge |
Build succeeded: |
Fixes #10814
Currently if an invalid enum value is provided,
(nil, true)
is returned here. Onpulumi convert
, we still try to translate the PCL to the resulting language here, causing an unhelpful error message(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference)
to be injected into the invalid program text (example in #10814).This change improves it a bit so that the valid enum values are provided in the error message, i.e.
(PANIC=Format method: fatal: A failure has occurred: Invalid enum provided: valid values are [Block Append])