Skip to content

Commit c183327

Browse files
committed
Include key in Dictionary::operator[] error message
Include key in error message when lookup fails
1 parent ef34c3d commit c183327

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/variant/dictionary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const Variant &Dictionary::operator[](const Variant &p_key) const {
133133
} else {
134134
static Variant empty;
135135
const Variant *value = _p->variant_map.getptr(key);
136-
ERR_FAIL_COND_V_MSG(!value, empty, "Bug: Dictionary::operator[] used when there was no value for the given key, please report.");
136+
ERR_FAIL_COND_V_MSG(!value, empty, vformat(R"(Bug: Dictionary::operator[] used when there was no value for the given key "%s". Please report.)", key));
137137
return *value;
138138
}
139139
}

0 commit comments

Comments
 (0)