Skip to content

added error for override parameters undefined issue #20963

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@
"loc.messages.EncodingNotSupported": "Encoding of the file '%s' is '%s' which is not supported. Supported file encodings are ['utf-8', 'utf-16le']",
"loc.messages.CouldNotDetectEncoding": "Could not detect encoding of file '%s'",
"loc.messages.DetectedFileEncoding": "The detected encoding for file '%s' is '%s'",
"loc.messages.ErrorWhileParsingParameter": "There was an error while overriding '%s' parameter because of '%s', make sure it follows JavaScript Object Notation (JSON)",
"loc.messages.ErrorWhileParsingParameter": "The provided metadata file '%s' is missing metadata of parameter '%s'",
"loc.messages.TemplateFilePatternMatchingMoreThanOneFile": "Found multiple files matching template file pattern: %s",
"loc.messages.TemplateParameterFilePatternMatchingMoreThanOneFile": "Found multiple files matching template parameters file pattern: %s",
"loc.messages.TemplateFilePatternMatchingNoFile": "Could not find any file matching the template file pattern",
Original file line number Diff line number Diff line change
@@ -370,8 +370,8 @@ class Utils {

try {
overrideParameter.value = this.castToType(overrideParameter.value, template.parameters[overrideParameter.name].type);
} catch (error) {
console.log(tl.loc("ErrorWhileParsingParameter", overrideParameter.name, error.toString()));
} catch (error) {
Copy link
Contributor

@starkmsu starkmsu Apr 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong, we shouldn't replace the error message but we need to create a new error message that we will be displayed in a special case when template.parameters[overrideParameter.name] is undefined.
Currently for all possible errors we show only this new error message - which is wrong.

tl.error(tl.loc("ErrorWhileParsingParameter", taskParameters.csmFile, overrideParameter.name));
}
parameters[overrideParameter.name] = {
value: overrideParameter.value
2 changes: 1 addition & 1 deletion Tasks/AzureResourceManagerTemplateDeploymentV3/task.json
Original file line number Diff line number Diff line change
@@ -310,7 +310,7 @@
"EncodingNotSupported": "Encoding of the file '%s' is '%s' which is not supported. Supported file encodings are ['utf-8', 'utf-16le']",
"CouldNotDetectEncoding": "Could not detect encoding of file '%s'",
"DetectedFileEncoding": "The detected encoding for file '%s' is '%s'",
"ErrorWhileParsingParameter": "There was an error while overriding '%s' parameter because of '%s', make sure it follows JavaScript Object Notation (JSON)",
"ErrorWhileParsingParameter": "The provided metadata file '%s' is missing metadata of parameter '%s'",
"TemplateFilePatternMatchingMoreThanOneFile": "Found multiple files matching template file pattern: %s",
"TemplateParameterFilePatternMatchingMoreThanOneFile": "Found multiple files matching template parameters file pattern: %s",
"TemplateFilePatternMatchingNoFile": "Could not find any file matching the template file pattern",