fix: Escape brace of dumped JSON for index err message (#37504)

Related to #37503

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/37506/head
congqixia 2024-11-07 18:58:25 +08:00 committed by GitHub
parent 7ec449fee5
commit 5310d3469f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 5 deletions

View File

@ -408,11 +408,13 @@ VectorMemIndex<T>::Query(const DatasetPtr dataset,
auto res = index_.Search(dataset, search_conf, bitset);
milvus::tracer::AddEvent("finish_knowhere_index_search");
if (!res.has_value()) {
PanicInfo(ErrorCode::UnexpectedError,
"failed to search: config={} {}: {}",
search_conf.dump(),
KnowhereStatusString(res.error()),
res.what());
PanicInfo(
ErrorCode::UnexpectedError,
// escape json brace in case of using message as format
"failed to search: config={{{}}} {}: {}",
search_conf.dump(),
KnowhereStatusString(res.error()),
res.what());
}
return res.value();
}