enhance: return exception type name when segcore return unkonwn exception (#38326)

relate: https://github.com/milvus-io/milvus/issues/38265

Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
This commit is contained in:
aoiasd 2024-12-25 18:58:50 +08:00 committed by GitHub
parent 25f0c82ceb
commit c7ea09a8be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 6 deletions

View File

@ -212,11 +212,13 @@ class Future : public IFuture {
ready->setValue(LeakyResult<R>(
static_cast<int>(e.get_error_code()), e.what()));
})
.thenError(folly::tag_t<std::exception>{},
[ready = ready_](const std::exception& e) {
ready->setValue(LeakyResult<R>(
milvus::UnexpectedError, e.what()));
});
.thenError(
folly::tag_t<std::exception>{},
[ready = ready_](const std::exception& e) {
ready->setValue(LeakyResult<R>(
milvus::UnexpectedError,
fmt::format("{} :{}", typeid(e).name(), e.what())));
});
}
private:

View File

@ -1280,7 +1280,7 @@ class TestCollectionSearchInvalid(TestcaseBase):
expr,
check_task=CheckTasks.err_res,
check_items={"err_code": 65535,
"err_msg": "query failed: Operator::GetOutput failed"})
"err_msg": "query failed: N6milvus21ExecOperatorExceptionE :Operator::GetOutput failed"})
class TestCollectionSearch(TestcaseBase):