Skip to content

Commit 25d32fc

Browse files
author
danghai
committed
Make configuration validation function return validation error message
1 parent 982f906 commit 25d32fc

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

lib/tlog/play_conf.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ tlog_play_conf_load(struct tlog_errs **perrs,
136136
json_object_put(overlay);
137137
overlay = NULL;
138138

139+
/* Check validate the config */
140+
assert(tlog_play_conf_validate(NULL,
141+
conf,
142+
TLOG_CONF_ORIGIN_ARGS) == TLOG_RC_OK);
143+
139144
grc = TLOG_RC_OK;
140145
*pcmd_help = cmd_help;
141146
cmd_help = NULL;

lib/tlog/rec_conf.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ tlog_rec_conf_load(struct tlog_errs **perrs,
250250
json_object_put(overlay);
251251
overlay = NULL;
252252

253+
/* Check validate the config */
254+
assert(tlog_rec_conf_validate(NULL,
255+
conf,
256+
TLOG_CONF_ORIGIN_ARGS) == TLOG_RC_OK);
257+
253258
grc = TLOG_RC_OK;
254259
*pcmd_help = cmd_help;
255260
cmd_help = NULL;

lib/tlog/rec_session_conf.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ tlog_rec_session_conf_load(struct tlog_errs **perrs,
265265
json_object_put(overlay);
266266
overlay = NULL;
267267

268+
/* Check validate the config */
269+
assert(tlog_rec_session_conf_validate(NULL,
270+
conf,
271+
TLOG_CONF_ORIGIN_ARGS) ==
272+
TLOG_RC_OK);
273+
268274
grc = TLOG_RC_OK;
269275
*pcmd_help = cmd_help;
270276
cmd_help = NULL;

0 commit comments

Comments
 (0)