On Sun, 16 Sep 2012, Bernhard Graf via RT wrote:
Show quoted text>> On Sun Oct 16 16:54:55 2011, GRAF wrote:
>>> A reference type parameter like
>>> type => ARRAYREF
>>> gives an error message like
>>>
>>> The 'foo' parameter (\"ARRAY(0x817ca38)\") to action did not pass the
>>> 'array' callback
>>
>> What would you prefer?
>
> Omitting (\"ARRAY(0xXXX)\").
>
> Actually I'd like to return the messages to the interface user, so
> personally I would prefer even lesser technical messages - something
> without "'array' callback" in this case, or no "did not pass regex
> check" elsewhere. A general "did not pass the parameter specification"
> is sufficiant to make the user RTFM.
You could use the Moose type constraint system with
MooseX::Params::Validate (or wait for me to release a production-ready
Type distro). Both of these allow you to provide an error message
generator with a type.
-dave
/*============================================================
http://VegGuide.org http://blog.urth.org
Your guide to all that's veg House Absolute(ly Pointless)
============================================================*/