mirror of
https://github.com/openharmony/developtools_global_resource_tool.git
synced 2026-07-20 22:47:00 -04:00
optimize error message for error label in json file
Signed-off-by: liduo <liduo29@huawei.com> Change-Id: I8379aea3b9e451c4768bb038a471f86e5c416180
This commit is contained in:
@@ -88,7 +88,7 @@ uint32_t ReferenceParser::ParseRefInResourceItem(ResourceItem &resourceItem) con
|
|||||||
if (IsStringOfResourceItem(resType)) {
|
if (IsStringOfResourceItem(resType)) {
|
||||||
data = string(reinterpret_cast<const char *>(resourceItem.GetData()), resourceItem.GetDataLength());
|
data = string(reinterpret_cast<const char *>(resourceItem.GetData()), resourceItem.GetDataLength());
|
||||||
if (!ParseRefString(data, update)) {
|
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;
|
return RESTOOL_ERROR;
|
||||||
}
|
}
|
||||||
if (!update) {
|
if (!update) {
|
||||||
@@ -149,6 +149,7 @@ bool ReferenceParser::ParseRefJson(const string &from, const string &to)
|
|||||||
}
|
}
|
||||||
bool needSave = false;
|
bool needSave = false;
|
||||||
if (!ParseRefJsonImpl(root_, needSave)) {
|
if (!ParseRefJsonImpl(root_, needSave)) {
|
||||||
|
cerr << "Error: please check JSON file." << NEW_LINE_PATH << from << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,7 +180,7 @@ bool ReferenceParser::ParseRefResourceItemData(const ResourceItem &resourceItem,
|
|||||||
for (auto &content : contents) {
|
for (auto &content : contents) {
|
||||||
bool flag = false;
|
bool flag = false;
|
||||||
if (!ParseRefString(content, flag)) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
update = (update || flag);
|
update = (update || flag);
|
||||||
|
|||||||
Reference in New Issue
Block a user