Skip to content

Commit

Permalink
edit error message
Browse files Browse the repository at this point in the history
  • Loading branch information
JackChuengQAQ committed Oct 28, 2024
1 parent 96d43e4 commit 00ba5c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/graph/executor/mutate/DeleteExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ folly::Future<Status> DeleteVerticesExecutor::deleteVertices() {
continue;
}
if (!SchemaUtil::isValidVid(val, *spaceInfo.spaceDesc.vid_type_ref())) {
auto errorMsg = fmt::format("Wrong vid type `{}`, value `{}`", val.type(), val.toString());
auto errorMsg = fmt::format(
"Wrong vid type `{}`, value `{}`", Value::toString(val.type()), val.toString());
return Status::Error(errorMsg);
}
vertices.emplace_back(std::move(val));
Expand Down Expand Up @@ -102,7 +103,8 @@ folly::Future<Status> DeleteTagsExecutor::deleteTags() {
continue;
}
if (!SchemaUtil::isValidVid(val, *spaceInfo.spaceDesc.vid_type_ref())) {
auto errorMsg = fmt::format("Wrong vid type `{}`, value `{}`", val.type(), val.toString());
auto errorMsg = fmt::format(
"Wrong vid type `{}`, value `{}`", Value::toString(val.type()), val.toString());
return Status::Error(errorMsg);
}
delTag.id_ref() = val;
Expand Down
3 changes: 2 additions & 1 deletion src/graph/executor/mutate/UpdateExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ folly::Future<Status> UpdateVertexExecutor::execute() {
continue;
}
if (!SchemaUtil::isValidVid(val, *spaceInfo.spaceDesc.vid_type_ref())) {
auto errorMsg = fmt::format("Wrong vid type `{}`, value `{}`", val.type(), val.toString());
auto errorMsg = fmt::format(
"Wrong vid type `{}`, value `{}`", Value::toString(val.type()), val.toString());
return Status::Error(errorMsg);
}
vertices.emplace_back(std::move(val));
Expand Down
9 changes: 5 additions & 4 deletions src/graph/validator/MutateValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ Status DeleteVerticesValidator::validateImpl() {
if (type.value() != vidType_) {
auto errorMsg = fmt::format("The vid `{}` should be type of `{}`, but was `{}`",
vidRef_->toString(),
vidType_,
Value::toString(vidType_),
type.value());
return Status::SemanticError(errorMsg);
}
Expand Down Expand Up @@ -463,7 +463,7 @@ Status DeleteTagsValidator::validateImpl() {
if (type.value() != vidType_) {
auto errorMsg = fmt::format("The vid `{}` should be type of `{}`, but was `{}`",
vidRef_->toString(),
vidType_,
Value::toString(vidType_),
type.value());
return Status::SemanticError(errorMsg);
}
Expand Down Expand Up @@ -675,7 +675,8 @@ Status UpdateValidator::getCondition() {
auto type = typeStatus.value();
if (type != Value::Type::BOOL && type != Value::Type::NULLVALUE &&
type != Value::Type::__EMPTY__) {
auto errorMsg = fmt::format("`{}`, expected Boolean, but was `{}`", filter->toString(), type);
auto errorMsg = fmt::format(
"`{}`, expected Boolean, but was `{}`", filter->toString(), Value::toString(type));
return Status::SemanticError(errorMsg);
}
condition_ = filter->encode();
Expand Down Expand Up @@ -853,7 +854,7 @@ Status UpdateVertexValidator::validateImpl() {
if (type.value() != vidType_) {
auto errorMsg = fmt::format("The vid `{}` should be type of `{}`, but was `{}`",
vidRef_->toString(),
vidType_,
Value::toString(vidType_),
type.value());
return Status::SemanticError(errorMsg);
}
Expand Down

0 comments on commit 00ba5c9

Please sign in to comment.