[Serdev] [Patch] Ability to check negative reply code in the failure_route

Dan Pascu dan at ag-projects.com
Mon Mar 7 13:46:54 UTC 2005


On Monday 07 March 2005 15:14, Maxim Sobolev wrote:
> Looks like that it does what we want, the main problem then is the lack
> of proper documentation. However, my patch may be still valid since it
> provides unified way to access negative status in failure route similar
> to the way to check status in reply route. 

Having a consistent way of doing the tests is good, none argues with that.
I asked just because I was curious if this new approach acts any different 
than the old one, except for the more convenient way of calling it.

In fact the most consistent way of doing the test, would be if the status in 
the failure route would be available under the same name: 'status', not like 
failure_status (i.e. 'status' always holds the status code no matter if in 
on_reply or failure routes and you write the test the same way in both of 
them). I'm not sure if that is possible though.

> Alternatively, use of status 
> builtin in the routing script should be depreciated in the favour of
> t_check_status(), which provides the same functionality.

I wouldn't deprecate status. status is better than t_check_status() from one 
point of view: it is clear from the syntax if it applies to a regular 
expression match or a simple comparison match depending what operator you 
use, while for t_check_status() you need to read the docs to know what type 
of parameter it accepts and how is interpreted.
Because of this status is better: is simpler and more intuitive to use.


-- 
Dan




More information about the Serdev mailing list