Skip Menu |

This queue is for tickets about the Type-Tiny CPAN distribution.

Report information
The Basics
Id: 89234
Status: resolved
Priority: 0/
Queue: Type-Tiny

People
Owner: perl [...] toby.ink
Requestors: haarg [...] haarg.org
Cc:
AdminCc:

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



Subject: Moo attribute information not included in exception messages
Type::Tiny will collect the information about the attribute being checked when used as an isa in a Moo class. However, this information isn't included when stringifying the exception object.
It's included in the message for the constructor, but not accessors... $ perl -Ilib -E'package Foo; use Moo; use Types::Standard -types; has foo => (is=>"rw",isa=>Int); Foo->new(foo => 1.1)' Value "1.1" did not pass type constraint "Int" (in $self->{"foo"}) at (eval 223) line 40 Value "1.1" did not pass type constraint "Int" (in $self->{"foo"}) "Int" is defined as: (defined $_ and $_ =~ /\A-?[0-9]+\z/) $ perl -Ilib -E'package Foo; use Moo; use Types::Standard -types; has foo => (is=>"rw",isa=>Int); Foo->new->foo(1.1)' Value "1.1" did not pass type constraint "Int" at (eval 224) line 15 Value "1.1" did not pass type constraint "Int" "Int" is defined as: (defined $_ and $_ =~ /\A-?[0-9]+\z/)
OK, changed to include the attribute name in messages generated in accessors too.
Fixed in 0.030.