Skip to content

Commit

Permalink
enhance: return exception type name when segcore return unkonwn excep…
Browse files Browse the repository at this point in the history
…tion (#38326)

relate: #38265

Signed-off-by: aoiasd <[email protected]>
  • Loading branch information
aoiasd authored Dec 25, 2024
1 parent 25f0c82 commit c7ea09a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions internal/core/src/futures/Future.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/python_client/testcases/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ def test_search_dynamic_compare_two_fields(self):
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):
Expand Down

0 comments on commit c7ea09a

Please sign in to comment.