Return an error when a variable doesn't exist. Add new |?
syntax.
#10631
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Now when a variable cannot be substituted it will return an error instead of silently removing the input. Adds new syntax for
|?
at the end of a variable chain to allow the previous behavior.Why is it important?
Previously, when a variable didn't exist, the entire input would be silently removed without any error or log message. This change fixes that behavior by throwing an error when a variable cannot be substituted in an input.
Checklist
./changelog/fragments
using the changelog tool[ ] I have added an integration test or an E2E test(covered by unit tests)Disruptive User Impact
This will require users to update the policy or configuration if they want the previous behavior.
How to test this PR locally
|?
at the end and run it again, see that no error is logged and that the input is missing.Related issues