[Maypole] 2.07 PR
Tony Bowden
tony@kasei.com
Tue, 18 Jan 2005 10:13:09 +0000
On Tue, Jan 18, 2005 at 09:45:52AM +0000, Dave Howorth wrote:
> Well yesterday I wrote a handler for DateTime (actually
> DateTime::Format::ISO8601). When you pass it an invalid date DT says
> things like:
> The 'month' parameter ("21") to DateTime::new did not pass the
> 'is between 1 and 12' callback
> which I think would be more helpful to the user than CGI::Untaint's:
> time_of_record (1999-21-22) does not pass the is_valid() check
In your is_valid() method for the handler, just die with that error. The
"does not pass the is_valid()" message is just the default message if
you return false from is_valid. If you throw an exception it will DTRT.
Tony