Skip to content

Commit 60aae6d

Browse files
committed
Merge pull request #86653 from Mickeon/string-format-error
Improve error message for `String.format` when using nested Arrays
2 parents a13d054 + 3b2d4ac commit 60aae6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/string/ustring.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3863,7 +3863,7 @@ String String::format(const Variant &values, const String &placeholder) const {
38633863

38643864
new_string = new_string.replace(placeholder.replace("_", key), val);
38653865
} else {
3866-
ERR_PRINT(String("STRING.format Inner Array size != 2 ").ascii().get_data());
3866+
ERR_PRINT(vformat("Invalid format: the inner Array at index %d needs to contain only 2 elements, as a key-value pair.", i).ascii().get_data());
38673867
}
38683868
} else { //Array structure ["RobotGuy","Logis","rookie"]
38693869
Variant v_val = values_arr[i];

0 commit comments

Comments
 (0)