CC: | steve.purkis [...] net-a-porter.com |
Subject: | More verbose validation error messages |
Currently, when validation fails you get error messages like:
died: Attribute (payload) does not pass the type constraint because:
Validation failed for
'MooseX::Types::Structured::Dict[channel,Int,start,Str...]' failed with
value HASH(0x9d19c68) at lib/My/Example/Tele.pm line 190
This doesn't help you track down *why* validation failed, which would be
really useful for nested data structures, ala:
has payload =>
(
is => 'rw',
isa => Dict[
channel => Int,
start => Str,
shows => ArrayRef[
Dict[
show_id => Int,
show_name => Str,
category_id => Num,
]
],
],
required => 1
);
If I mistype 'start' => 'starrt' it would be nice to have an error like:
'Field "start" is missing"'
Or similar.