I agree completely. In my project my validation_error method has to do just that: recall the original method with all arguments + and errors argument.
This seems the best approach and the code is fairly boiler plate. It would be nice to see this as the default behaviour in TG. Krys [EMAIL PROTECTED] wrote: >I begin to start using the validator and got confused of what is the >design philosophy behind it. > >1. There is an instance method validator_error that would be called if >exist otherwise it would raise another exception. > >I believe this has to be mentioned in the documentation as otherwise, >this exception would not be caught by anyone and it would be the ugly >"server get in trouble" message, which is very scary but not the case. >Just some data content error. > >If validator_error is defined, if will be called with the first >parameter being the original function(the one that turbogears.expose >supposed to be decorating). > >While the documentation said I can do whatever I want, I think it would >be more natural to let the original function deal with it as this >validator_error is a "centralized" function(sort of catch all) that is >impossible to make meaningful error message/response. > >Would it be better to just have a convention that any exposed function >that has validator enabled should expect one more argument "error=None" >to indicate such condition and let it do its job there ? > > > >

