提交 3a8bf9ad 编写于 作者: wmmhello's avatar wmmhello

[TD-5992] add error msg

上级 10239539
...@@ -442,13 +442,11 @@ int taos_options(TSDB_OPTION option, const void *arg, ...) { ...@@ -442,13 +442,11 @@ int taos_options(TSDB_OPTION option, const void *arg, ...) {
static int taos_set_config_imp(const char *config){ static int taos_set_config_imp(const char *config){
static bool setConfFlag = false; static bool setConfFlag = false;
if (setConfFlag) { if (setConfFlag) {
printf("already set config");
return 0; return 0;
} }
taosInitGlobalCfg(); taosInitGlobalCfg();
cJSON *root = cJSON_Parse(config); cJSON *root = cJSON_Parse(config);
if (root == NULL) { if (root == NULL) {
printf("failed to set config, invalid json format: %s", config);
return -1; return -1;
} }
...@@ -456,13 +454,7 @@ static int taos_set_config_imp(const char *config){ ...@@ -456,13 +454,7 @@ static int taos_set_config_imp(const char *config){
int size = cJSON_GetArraySize(root); int size = cJSON_GetArraySize(root);
for(int i = 0; i < size; i++){ for(int i = 0; i < size; i++){
cJSON *item = cJSON_GetArrayItem(root, i); cJSON *item = cJSON_GetArrayItem(root, i);
if (!item) { if(item && !taosReadConfigOption(item->string, item->valuestring, NULL, NULL, TAOS_CFG_CSTATUS_OPTION)){
printf("failed to read index:%d", i);
ret = -2;
continue;
}
if(!taosReadConfigOption(item->string, item->valuestring, NULL, NULL, TAOS_CFG_CSTATUS_OPTION)){
printf("set failed:%s->%s, paras err or can not set from file", item->string, item->valuestring);
ret = -2; ret = -2;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册