optimize error message for error label in json file

Signed-off-by: liduo <liduo29@huawei.com>
Change-Id: I8379aea3b9e451c4768bb038a471f86e5c416180
This commit is contained in:
liduo
2024-05-22 15:49:07 +08:00
parent 16b769661e
commit ed8d448692
+3 -2
View File
@@ -88,7 +88,7 @@ uint32_t ReferenceParser::ParseRefInResourceItem(ResourceItem &resourceItem) con
if (IsStringOfResourceItem(resType)) {
data = string(reinterpret_cast<const char *>(resourceItem.GetData()), resourceItem.GetDataLength());
if (!ParseRefString(data, update)) {
cerr << "Error: " << NEW_LINE_PATH << resourceItem.GetFilePath() << endl;
cerr << "Error: please check JSON file." << NEW_LINE_PATH << resourceItem.GetFilePath() << endl;
return RESTOOL_ERROR;
}
if (!update) {
@@ -149,6 +149,7 @@ bool ReferenceParser::ParseRefJson(const string &from, const string &to)
}
bool needSave = false;
if (!ParseRefJsonImpl(root_, needSave)) {
cerr << "Error: please check JSON file." << NEW_LINE_PATH << from << endl;
return false;
}
@@ -179,7 +180,7 @@ bool ReferenceParser::ParseRefResourceItemData(const ResourceItem &resourceItem,
for (auto &content : contents) {
bool flag = false;
if (!ParseRefString(content, flag)) {
cerr << "Error: " << NEW_LINE_PATH << resourceItem.GetFilePath() << endl;
cerr << "Error: please check JSON file." << NEW_LINE_PATH << resourceItem.GetFilePath() << endl;
return false;
}
update = (update || flag);