diff --git a/src/graph/Executor.cpp b/src/graph/Executor.cpp index f3005c6d29a..7609d64b925 100644 --- a/src/graph/Executor.cpp +++ b/src/graph/Executor.cpp @@ -164,11 +164,11 @@ std::unique_ptr Executor::makeExecutor(Sentence *sentence) { executor = std::make_unique(sentence, ectx()); break; case Sentence::Kind::kUnknown: - LOG(FATAL) << "Sentence kind unknown"; - break; + LOG(ERROR) << "Sentence kind unknown"; + return nullptr; default: - LOG(FATAL) << "Sentence kind illegal: " << kind; - break; + LOG(ERROR) << "Sentence kind illegal: " << kind; + return nullptr; } return executor; } diff --git a/src/graph/SequentialExecutor.cpp b/src/graph/SequentialExecutor.cpp index 45a232fe99f..01b28ec0bc6 100644 --- a/src/graph/SequentialExecutor.cpp +++ b/src/graph/SequentialExecutor.cpp @@ -23,7 +23,9 @@ Status SequentialExecutor::prepare() { for (auto i = 0U; i < sentences_->sentences_.size(); i++) { auto *sentence = sentences_->sentences_[i].get(); auto executor = makeExecutor(sentence); - DCHECK(executor != nullptr); + if (executor == nullptr) { + return Status::Error("The statement has not been implemented"); + } auto status = executor->prepare(); if (!status.ok()) { FLOG_ERROR("Prepare executor `%s' failed: %s",