Throw exception not assert
This commit is contained in:
parent
7c01957295
commit
e36784b5e5
@ -199,7 +199,9 @@ VertexAccessor &CreateLocalVertexAtomically(const NodeCreationInfo &node_info, F
|
||||
}
|
||||
}
|
||||
// TODO Remove later on since that will be enforced from grammar side
|
||||
MG_ASSERT(!node_info.labels.empty(), "There must be at least one label!");
|
||||
if (node_info.labels.empty()) {
|
||||
throw QueryRuntimeException("There must be a primary label defined.");
|
||||
}
|
||||
const auto primary_label = node_info.labels[0];
|
||||
std::vector<storage::v3::LabelId> secondary_labels(node_info.labels.begin() + 1, node_info.labels.end());
|
||||
auto maybe_new_node = dba.InsertVertexAndValidate(primary_label, secondary_labels, properties);
|
||||
|
Loading…
Reference in New Issue
Block a user