Skip to content

Commit

Permalink
Update error code
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiee committed Apr 15, 2022
1 parent 4ce12b4 commit cc89e98
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/clients/meta/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3638,7 +3638,8 @@ Status MetaClient::saveVersionToMeta() {
}
auto resp = std::move(respStatus).value();
if (resp.get_code() != nebula::cpp2::ErrorCode::SUCCEEDED) {
return Status::Error("Failed to save graph version into meta, error code: %d", resp.get_code());
return Status::Error("Failed to save graph version into meta, error code: %s",
apache::thrift::util::enumNameSafe(resp.get_code()).c_str());
}
return Status::OK();
}
Expand Down
10 changes: 9 additions & 1 deletion src/meta/processors/admin/SaveGraphVersionProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ void SaveGraphVersionProcessor::process(const cpp2::SaveGraphVersionReq& req) {
versionData.emplace_back(std::move(versionKey), std::move(versionVal));

// Save the version of the graph service
handleErrorCode(doSyncPut(versionData));
auto errCode = doSyncPut(versionData);
if (errCode != nebula::cpp2::ErrorCode::SUCCEEDED) {
LOG(ERROR) << "Failed to save graph version, errorCode: "
<< apache::thrift::util::enumNameSafe(errCode);
handleErrorCode(errCode);
onFinished();
return;
}
handleErrorCode(nebula::cpp2::ErrorCode::SUCCEEDED);

onFinished();
}
Expand Down

0 comments on commit cc89e98

Please sign in to comment.