BUG/MINOR: resolvers: report the expression error in the do-resolve() action parser

When an expression is used for do-resolve(), an error may be reported.
Unfortunately it was scratched and replaced by the do-resolve() error,
leaving no chance to know exactly what was wrong. Let's report the
contents of the error when available. It will indicate identifiers that
are not found or invalid ranges or types being used.

This can be backported to all versions.
This commit is contained in:
Willy Tarreau 2026-05-14 22:43:17 +00:00
parent 0c8c9b1c2a
commit b15e9b1b29

View file

@ -3405,8 +3405,8 @@ enum act_parse_ret resolv_parse_do_resolve(const char **args, int *orig_arg, str
ha_free(&rule->arg.resolv.varname);
ha_free(&rule->arg.resolv.resolvers_id);
ha_free(&rule->arg.resolv.opts);
memprintf(err, "Can't parse '%s'. Expects 'do-resolve(<varname>,<resolvers>[,<options>]) <expr>'. Available options are 'ipv4' and 'ipv6'",
args[cur_arg]);
memprintf(err, "Can't parse '%s'%s%s. Expects 'do-resolve(<varname>,<resolvers>[,<options>]) <expr>'. Available options are 'ipv4' and 'ipv6'",
args[cur_arg], *err ? ": " : "", *err ? *err : "");
return ACT_RET_PRS_ERR;
}