From c7ea09a8be8760bead379a5d0f8904ba6422bffb Mon Sep 17 00:00:00 2001 From: aoiasd <45024769+aoiasd@users.noreply.github.com> Date: Wed, 25 Dec 2024 18:58:50 +0800 Subject: [PATCH] enhance: return exception type name when segcore return unkonwn exception (#38326) relate: https://github.com/milvus-io/milvus/issues/38265 Signed-off-by: aoiasd --- internal/core/src/futures/Future.h | 12 +++++++----- tests/python_client/testcases/test_search.py | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/core/src/futures/Future.h b/internal/core/src/futures/Future.h index 60eb804e96..210429c9ce 100644 --- a/internal/core/src/futures/Future.h +++ b/internal/core/src/futures/Future.h @@ -212,11 +212,13 @@ class Future : public IFuture { ready->setValue(LeakyResult( static_cast(e.get_error_code()), e.what())); }) - .thenError(folly::tag_t{}, - [ready = ready_](const std::exception& e) { - ready->setValue(LeakyResult( - milvus::UnexpectedError, e.what())); - }); + .thenError( + folly::tag_t{}, + [ready = ready_](const std::exception& e) { + ready->setValue(LeakyResult( + milvus::UnexpectedError, + fmt::format("{} :{}", typeid(e).name(), e.what()))); + }); } private: diff --git a/tests/python_client/testcases/test_search.py b/tests/python_client/testcases/test_search.py index 09f6ecfca9..1a008acdd2 100644 --- a/tests/python_client/testcases/test_search.py +++ b/tests/python_client/testcases/test_search.py @@ -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):