Skip to content

Commit e4ac6f8

Browse files
author
Günther Deschner
committed
Use verbose ding-libs error reporting when config parsing failed.
Signed-off-by: Günther Deschner <[email protected]> Reviewed-by: Simo Sorce <[email protected]>
1 parent d08d3f5 commit e4ac6f8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

proxy/src/gp_config_dinglibs.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,17 +244,25 @@ int gp_dinglibs_init(const char *config_file,
244244
}
245245

246246
ret = ini_config_parse(file_ctx,
247-
INI_STOP_ON_NONE, /* error_level */
247+
INI_STOP_ON_ANY, /* error_level */
248248
/* Merge section but allow duplicates */
249249
INI_MS_MERGE |
250250
INI_MV1S_ALLOW |
251251
INI_MV2S_ALLOW,
252252
INI_PARSE_NOWRAP, /* parse_flags */
253253
ini_config);
254254
if (ret) {
255+
char **errors = NULL;
255256
/* we had a parsing failure */
256257
GPDEBUG("Failed to parse config file: %d (%s)\n",
257258
ret, strerror(ret));
259+
if (ini_config_error_count(ini_config)) {
260+
ini_config_get_errors(ini_config, &errors);
261+
if (errors) {
262+
ini_config_print_errors(stderr, errors);
263+
ini_config_free_errors(errors);
264+
}
265+
}
258266
ini_config_file_destroy(file_ctx);
259267
ini_config_destroy(ini_config);
260268
return ret;

0 commit comments

Comments
 (0)