if (rcode < 0) return NULL; /* message already printed */
if (!head) {
cf_log_err_cs(cs, "'update' sections cannot be empty");
- return NULL;
+ cf_log_err_cs(cs, DOC_KEYWORD_REF(update));
}
g = talloc_zero(parent, modgroup);
name2 = cf_section_name2(cs);
if (!name2) {
cf_log_err_cs(cs, "You must specify a variable to switch over for 'switch'");
+ print_url:
+ cf_log_err_cs(cs, DOC_KEYWORD_REF(switch));
return NULL;
}
if (!cf_item_find_next(cs, NULL)) {
cf_log_err_cs(cs, "'switch' statements cannot be empty");
- return NULL;
+ goto print_url;
}
/*
talloc_free(spaces);
talloc_free(text);
- return NULL;
+ goto print_url;
}
/*
if (vpt->type == TMPL_TYPE_LIST) {
cf_log_err_cs(cs, "Syntax error: Cannot switch over list '%s'", name2);
- return NULL;
+ goto print_url;
}
/*
cf_log_err(ci, "\"switch\" sections can only have \"case\" subsections");
talloc_free(vpt);
- return NULL;
+ goto print_url;
}
subcs = cf_item_to_section(ci); /* can't return NULL */
if (strcmp(name1, "case") != 0) {
cf_log_err(ci, "\"switch\" sections can only have \"case\" subsections");
talloc_free(vpt);
- return NULL;
+ goto print_url;
}
name2 = cf_section_name2(subcs);
cf_log_err(ci, "Cannot have two 'default' case statements");
talloc_free(vpt);
- return NULL;
+ goto print_url;
}
}
talloc_free(spaces);
talloc_free(text);
+ cf_log_err_cs(cs, DOC_KEYWORD_REF(case));
return NULL;
}
if (!cf_item_find_next(cs, NULL)) {
cf_log_err_cs(cs, "'foreach' blocks cannot be empty");
+ print_url:
+ cf_log_err_cs(cs, DOC_KEYWORD_REF(forach));
return NULL;
}
talloc_free(spaces);
talloc_free(text);
- return NULL;
+ goto print_url;
}
/*
if ((vpt->type != TMPL_TYPE_ATTR) && (vpt->type != TMPL_TYPE_LIST)) {
cf_log_err_cs(cs, "MUST use attribute or list reference in 'foreach'");
- return NULL;
+ goto print_url;
}
/*
if (!cs) {
cf_log_err(ci, "'break' can only be used in a 'foreach' section");
+ cf_log_err_cs(cs, DOC_KEYWORD_REF(break));
return NULL;
}
*modname = name2;
if (!all_children_are_modules(cs, modrefname)) {
+ cf_log_err_cs(cs, DOC_KEYWORD_REF(redundant));
return NULL;
}
*modname = name2;
if (!all_children_are_modules(cs, modrefname)) {
+ cf_log_err_cs(cs, DOC_KEYWORD_REF(load-balance));
return NULL;
}
*modname = name2;
if (!all_children_are_modules(cs, modrefname)) {
+ cf_log_err_cs(cs, DOC_KEYWORD_REF(redundant-load-balance));
return NULL;
}
} else if (strcmp(modrefname, "if") == 0) {
if (!cf_section_name2(cs)) {
cf_log_err(ci, "'if' without condition");
+ cf_log_err_cs(cs, DOC_KEYWORD_REF(if));
return NULL;
}
((parent->type == MOD_LOAD_BALANCE) ||
(parent->type == MOD_REDUNDANT_LOAD_BALANCE))) {
cf_log_err(ci, "'elsif' cannot be used in this section");
+ cf_log_err_cs(cs, DOC_KEYWORD_REF(elsif));
return NULL;
}
if (!cf_section_name2(cs)) {
cf_log_err(ci, "'elsif' without condition");
+ cf_log_err_cs(cs, DOC_KEYWORD_REF(elsif));
return NULL;
}
((parent->type == MOD_LOAD_BALANCE) ||
(parent->type == MOD_REDUNDANT_LOAD_BALANCE))) {
cf_log_err(ci, "'else' cannot be used in this section section");
+ cf_log_err_cs(cs, DOC_KEYWORD_REF(else));
return NULL;
}
if (cf_section_name2(cs)) {
cf_log_err(ci, "Cannot have conditions on 'else'");
+ cf_log_err_cs(cs, DOC_KEYWORD_REF(else));
return NULL;
}
if (strcmp(modrefname, "return") == 0) {
if (!cf_item_is_pair(ci)) {
cf_log_err(ci, "Invalid use of 'return' as section name.");
+ cf_log_err_cs(cs, DOC_KEYWORD_REF(return));
return NULL;
}