]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: pattern: report the precise argument parsing error when known.
authorWilly Tarreau <w@1wt.eu>
Fri, 20 Apr 2012 14:04:47 +0000 (16:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 8 May 2012 18:57:13 +0000 (20:57 +0200)
commitb27c0d35dd198c5cd2264f681c4f2d20efbe2e75
treee6ea14be426c7af85ea4ee4ac092cb96747dc02b
parent21d68a68953a1d03a7e881bc5586e908fbf38404
MEDIUM: pattern: report the precise argument parsing error when known.

The argument parser knows what exact error it has faced, and the pattern
parser is able to report errors, so let's make use of it. From now on, it
becomes possible to detect such things :

$ ./haproxy -db -f echo5.cfg
[ALERT] 110/160344 (4791) : parsing [echo5.cfg:38] : 'stick': invalid arg 2 in fetch method 'payload' : Missing arguments (got 1/2), type 'unsigned integer' expected.
[ALERT] 110/160344 (4791) : parsing [echo5.cfg:39] : 'stick': invalid args in fetch method 'payload' : payload length must be > 0.
[ALERT] 110/160344 (4791) : parsing [echo5.cfg:40] : 'stick': invalid arg 3 in fetch method 'payload_lv' : Failed to parse 'x' as type 'signed integer'.
[ALERT] 110/160344 (4791) : parsing [echo5.cfg:41] : 'stick': invalid arg 4 in fetch method 'payload_lv' : End of arguments expected at ',13'.
[ALERT] 110/160344 (4791) : Error(s) found in configuration file : echo5.cfg
[ALERT] 110/160344 (4791) : Fatal errors found in configuration.
src/pattern.c