diff --git a/cpp/src/server/grpc_impl/RequestHandler.cpp b/cpp/src/server/grpc_impl/RequestHandler.cpp index 43252179991f37dc6f18db576f6de589ee92c3a9..8aba535112165d70b9b2a6f890b2f0216266cab1 100644 --- a/cpp/src/server/grpc_impl/RequestHandler.cpp +++ b/cpp/src/server/grpc_impl/RequestHandler.cpp @@ -73,8 +73,14 @@ RequestHandler::SearchVector(::grpc::ServerContext* context, const ::milvus::grp RequestHandler::SearchVectorInFiles(::grpc::ServerContext* context, const ::milvus::grpc::SearchVectorInFilesInfos* request, ::grpc::ServerWriter<::milvus::grpc::TopKQueryResult>* writer) { std::vector file_id_array; BaseTaskPtr task_ptr = SearchVectorTask::Create(request->search_vector_infos(), file_id_array, *writer); - RequestScheduler::ExecTask(task_ptr, nullptr); - return ::grpc::Status::OK; + ::milvus::grpc::Status grpc_status; + RequestScheduler::ExecTask(task_ptr, &grpc_status); + if (grpc_status.error_code() != SERVER_SUCCESS) { + ::grpc::Status status(::grpc::INVALID_ARGUMENT, grpc_status.reason()); + return status; + } else { + return ::grpc::Status::OK; + } } ::grpc::Status