Skip to content

Commit

Permalink
Improve a bit the error messages for invalid config files
Browse files Browse the repository at this point in the history
  • Loading branch information
jvoisin committed Jan 15, 2024
1 parent 4b7967d commit 85133e2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/snuffleupagus.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,13 +512,15 @@ static PHP_INI_MH(OnUpdateConfiguration) {
glob_t globbuf;
if (0 != glob(config_file, GLOB_NOCHECK, NULL, &globbuf)) {
SPG(is_config_valid) = SP_CONFIG_INVALID;
sp_log_err("config", "Error while expanding %s.", config_file);
globfree(&globbuf);
return FAILURE;
}

for (size_t i = 0; globbuf.gl_pathv[i]; i++) {
if (sp_parse_config(globbuf.gl_pathv[i]) != SUCCESS) {
SPG(is_config_valid) = SP_CONFIG_INVALID;
sp_log_err("config", "Error while parsing %s.", globbuf.gl_pathv[i]);
globfree(&globbuf);
return FAILURE;
}
Expand Down

0 comments on commit 85133e2

Please sign in to comment.