提交 59c457cd 编写于 作者: G groot

add more error handling


Former-commit-id: 0105341107a2d54e23921b71168001cb5b218447
上级 41bfe4bf
......@@ -37,12 +37,16 @@ DBWrapper::DBWrapper() {
opt.meta.archive_conf.SetCriterias(criterial);
//create db root folder
CommonUtil::CreateDirectory(opt.meta.path);
ServerError err = CommonUtil::CreateDirectory(opt.meta.path);
if(err != SERVER_SUCCESS) {
std::cout << "ERROR! Failed to create database root path: " << opt.meta.path << std::endl;
kill(0, SIGUSR1);
}
zilliz::milvus::engine::DB::Open(opt, &db_);
if(db_ == nullptr) {
SERVER_LOG_ERROR << "Failed to open db";
throw ServerException(SERVER_NULL_POINTER, "Failed to open db");
std::cout << "ERROR! Failed to open database" << std::endl;
kill(0, SIGUSR1);
}
}
......
......@@ -23,6 +23,7 @@
#include <thrift/concurrency/PosixThreadFactory.h>
#include <thread>
#include <iostream>
namespace zilliz {
namespace milvus {
......@@ -92,7 +93,8 @@ MilvusServer::StartService() {
return;
}
} catch (apache::thrift::TException& ex) {
//SERVER_LOG_ERROR << "Server encounter exception: " << ex.what();
std::cout << "ERROR! " << ex.what() << std::endl;
kill(0, SIGUSR1);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册