mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-01-28 01:47:18 +01:00
Shows fault messages reported from micro-service instead of standard messages.
This commit is contained in:
parent
14b106dfd8
commit
6e40cbdba1
1 changed files with 12 additions and 3 deletions
|
|
@ -1308,8 +1308,11 @@ static int add_ubus_object(struct dmctx *dmctx, struct dmnode *node)
|
|||
res_obj = json_object_array_get_idx(res_array, i);
|
||||
|
||||
char *fault = dmjson_get_value(res_obj, 1, "fault");
|
||||
if (DM_STRLEN(fault))
|
||||
if (DM_STRLEN(fault)) {
|
||||
char *fault_msg = dmjson_get_value(res_obj, 1, "fault_msg");
|
||||
bbfdm_set_fault_message(dmctx, "%s", fault_msg);
|
||||
return DM_STRTOUL(fault);
|
||||
}
|
||||
|
||||
char *data = dmjson_get_value(res_obj, 1, "data");
|
||||
|
||||
|
|
@ -1353,8 +1356,11 @@ static int del_ubus_object(struct dmctx *dmctx, struct dmnode *node)
|
|||
dmctx->stop = 1;
|
||||
|
||||
char *fault = dmjson_get_value(res_obj, 1, "fault");
|
||||
if (DM_STRLEN(fault))
|
||||
if (DM_STRLEN(fault)) {
|
||||
char *fault_msg = dmjson_get_value(res_obj, 1, "fault_msg");
|
||||
bbfdm_set_fault_message(dmctx, "%s", fault_msg);
|
||||
return DM_STRTOUL(fault);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -1428,8 +1434,11 @@ static int set_ubus_value(struct dmctx *dmctx, struct dmnode *node)
|
|||
dmctx->stop = 1;
|
||||
|
||||
char *fault = dmjson_get_value(res_obj, 1, "fault");
|
||||
if (DM_STRLEN(fault))
|
||||
if (DM_STRLEN(fault)) {
|
||||
char *fault_msg = dmjson_get_value(res_obj, 1, "fault_msg");
|
||||
bbfdm_set_fault_message(dmctx, "%s", fault_msg);
|
||||
return DM_STRTOUL(fault);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue