Skip Menu |

This queue is for tickets about the MooseX-Params-Validate CPAN distribution.

Report information
The Basics
Id: 89378
Status: open
Priority: 0/
Queue: MooseX-Params-Validate

People
Owner: Nobody in particular
Requestors: cybersg [...] gmail.com
jabbas [...] jabbas.eu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: subtype messages are ignored when MooseX::Params::Validate are used
Date: Thu, 10 Oct 2013 10:17:43 +0200
To: bug-MooseX-Params-Validate [...] rt.cpan.org
From: Grzegorz Dzięgielewski <jabbas [...] jabbas.eu>
When you define subtypes with message {} and use this type in MooseX::Params::Validate it throws exception without defined message. example: #!/usr/bin/env perl package Foo; use Moose; use Moose::Util::TypeConstraints; use MooseX::Params::Validate; subtype "Something" => as "Int" => where {$_>0} => message { "more than zero" } ; sub bar { my ($self, $bar) = validated_list( \@_, baz => { isa => 'Something' } ); } use Test::Exception tests => 2; my $a = Foo->new(); lives_ok { $->bar(baz => 1) }; throws_ok { $a->bar(baz => 0) } qr/more than zero/; -- Grzegorz Dzięgielewski http://jabbas.eu
This is implemented in 0.20, just released on CPAN.