File Coverage

blib/lib/Moose/Exception/CouldNotEvalConstructor.pm
Criterion Covered Total %
statement 7 7 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 9 9 100.0


line stmt bran cond sub pod time code
1             package Moose::Exception::CouldNotEvalConstructor;
2             our $VERSION = '2.2206';
3              
4 1     1   558 use Moose;
  1         3  
  1         8  
5             extends 'Moose::Exception';
6              
7             has 'constructor_method' => (
8             is => 'ro',
9             isa => 'Class::MOP::Method::Constructor',
10             required => 1
11             );
12              
13             has 'source' => (
14             is => 'ro',
15             isa => 'Str',
16             required => 1
17             );
18              
19             has 'error' => (
20             is => 'ro',
21             isa => 'Str',
22             required => 1
23             );
24              
25             sub _build_message {
26 1     1   2 my $self = shift;
27 1         33 my $error = $self->error;
28 1         31 my $source = $self->source;
29              
30 1         28 return "Could not eval the constructor :\n\n$source\n\nbecause :\n\n$error";
31             }
32              
33             __PACKAGE__->meta->make_immutable;
34             1;