Sha256: 9b8587c2de90b6f01cd7b1c641541d6014e307a461508706a7bfc9fdcb1c5239
Contents?: true
Size: 740 Bytes
Versions: 33
Compression:
Stored size: 740 Bytes
Contents
package Moose::Exception::ValidationFailedForTypeConstraint; our $VERSION = '2.2207'; use Moose; extends 'Moose::Exception'; with 'Moose::Exception::Role::Attribute'; has 'value' => ( is => 'ro', isa => 'Any', required => 1, ); has 'type' => ( is => 'ro', isa => Moose::Util::TypeConstraints->duck_type(["get_message", "name"]), required => 1 ); sub _build_message { my $self = shift; my $error = $self->type->get_message( $self->value ); return $error unless $self->is_attribute_set; my $attribute_name = $self->attribute->name; return "Attribute ($attribute_name) does not pass the type constraint because: $error"; } __PACKAGE__->meta->make_immutable; 1;
Version data entries
33 entries across 21 versions & 1 rubygems