Skip to content

Commit 3b2d4ac

Browse files
committed
Improve error message for String.format when using nested Arrays
1 parent 13a0d6e commit 3b2d4ac

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
@@ -3536,7 +3536,7 @@ String String::format(const Variant &values, String placeholder) const {
35363536

35373537
new_string = new_string.replace(placeholder.replace("_", key), val);
35383538
} else {
3539-
ERR_PRINT(String("STRING.format Inner Array size != 2 ").ascii().get_data());
3539+
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());
35403540
}
35413541
} else { //Array structure ["RobotGuy","Logis","rookie"]
35423542
Variant v_val = values_arr[i];

0 commit comments

Comments
 (0)