From 3b2d4ac156088d38aa86108c79a0850c880a617d Mon Sep 17 00:00:00 2001 From: Micky Date: Sat, 30 Dec 2023 20:32:01 +0100 Subject: [PATCH] Improve error message for `String.format` when using nested Arrays --- core/string/ustring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index a24cff4f11..6b6a075814 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -3536,7 +3536,7 @@ String String::format(const Variant &values, String placeholder) const { new_string = new_string.replace(placeholder.replace("_", key), val); } else { - ERR_PRINT(String("STRING.format Inner Array size != 2 ").ascii().get_data()); + 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()); } } else { //Array structure ["RobotGuy","Logis","rookie"] Variant v_val = values_arr[i];