!133 日志描述优化

Merge pull request !133 from fyz1019/master
This commit is contained in:
openharmony_ci
2024-02-26 02:20:40 +00:00
committed by Gitee
5 changed files with 15 additions and 9 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ uint32_t ConfigParser::Init()
}
if (!root_ || !cJSON_IsObject(root_)) {
cerr << "Error: ConfigParser root node not obeject." << NEW_LINE_PATH << filePath_ << endl;
cerr << "Error: JSON file parsing failed, please check the JSON file." << NEW_LINE_PATH << filePath_ << endl;
return RESTOOL_ERROR;
}
+6 -3
View File
@@ -85,17 +85,20 @@ uint32_t IdDefinedParser::Init(const string &filePath, bool isSystem)
}
if (!root_ || !cJSON_IsObject(root_)) {
cerr << "Error: IdDefinedParser root node not obeject." << NEW_LINE_PATH << filePath << endl;
cerr << "Error: JSON file parsing failed, please check the JSON file.";
cerr << NEW_LINE_PATH << filePath << endl;
return RESTOOL_ERROR;
}
cJSON *recordNode = cJSON_GetObjectItem(root_, "record");
if (!recordNode || !cJSON_IsArray(recordNode)) {
cerr << "Error: id_defined.json record not array." << endl;
cerr << "Error: 'record' node is not an array, please check the JSON file.";
cerr << NEW_LINE_PATH << filePath << endl;
return RESTOOL_ERROR;
}
if (cJSON_GetArraySize(recordNode) == 0) {
cerr << "Error: id_defined.json 'record' empty." << endl;
cerr << "Error: 'record' node is empty, please check the JSON file.";
cerr << NEW_LINE_PATH << filePath << endl;
return RESTOOL_ERROR;
}
int32_t startSysId = 0;
+6 -3
View File
@@ -54,19 +54,22 @@ uint32_t JsonCompiler::CompileSingleFile(const FileInfo &fileInfo)
return RESTOOL_ERROR;
}
if (!root_ || !cJSON_IsObject(root_)) {
cerr << "Error: JsonCompiler root node not obeject." << NEW_LINE_PATH << fileInfo.filePath << endl;
cerr << "Error: JSON file parsing failed, please check the JSON file.";
cerr << NEW_LINE_PATH << fileInfo.filePath << endl;
return RESTOOL_ERROR;
}
cJSON *item = root_->child;
if (cJSON_GetArraySize(root_) != 1) {
cerr << "Error: root node must only one member." << NEW_LINE_PATH << fileInfo.filePath << endl;
cerr << "Error: node of a JSON file can only have one member, please check the JSON file.";
cerr << NEW_LINE_PATH << fileInfo.filePath << endl;
return RESTOOL_ERROR;
}
string tag = item->string;
auto ret = g_contentClusterMap.find(tag);
if (ret == g_contentClusterMap.end()) {
cerr << "Error: invalid tag name '" << tag << "'." << NEW_LINE_PATH << fileInfo.filePath << endl;
cerr << "Error: invalid tag name '" << tag << "', please check the JSON file.";
cerr << NEW_LINE_PATH << fileInfo.filePath << endl;
return RESTOOL_ERROR;
}
+1 -1
View File
@@ -144,7 +144,7 @@ bool ReferenceParser::ParseRefJson(const string &from, const string &to)
return false;
}
if (!root_ || !cJSON_IsObject(root_)) {
cerr << "Error: ReferenceParser root node not obeject." << NEW_LINE_PATH << from << endl;
cerr << "Error: JSON file parsing failed, please check the JSON file." << NEW_LINE_PATH << from << endl;
return RESTOOL_ERROR;
}
bool needSave = false;
+1 -1
View File
@@ -34,7 +34,7 @@ uint32_t ResConfigParser::Init(const string &filePath, HandleBack callback)
return RESTOOL_ERROR;
}
if (!root_ || !cJSON_IsObject(root_)) {
cerr << "Error: ResConfigParser root node not obeject." << NEW_LINE_PATH << filePath << endl;
cerr << "Error: JSON file parsing failed, please check the JSON file." << NEW_LINE_PATH << filePath << endl;
return RESTOOL_ERROR;
}
if (!callback) {