File Coverage

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


line stmt bran cond sub pod time code
1             package Moose::Exception::CircularReferenceInAlso;
2             our $VERSION = '2.2203';
3              
4 3     3   1713 use Moose;
  3         7  
  3         17  
5             extends 'Moose::Exception';
6              
7             has 'also_parameter' => (
8             is => 'ro',
9             isa => 'Str',
10             required => 1
11             );
12              
13             has 'stack' => (
14             is => 'ro',
15             isa => 'ArrayRef',
16             required => 1
17             );
18              
19             sub _build_message {
20 3     3   7 my $self = shift;
21 3         89 my $also_member = $self->also_parameter;
22              
23 3         7 my @stack = @{$self->stack};
  3         90  
24 3         24 my $existing_stack = join( ', ', @stack);
25              
26 3         75 return "Circular reference in 'also' parameter to Moose::Exporter between "
27             ."$existing_stack and $also_member";
28             }
29              
30             __PACKAGE__->meta->make_immutable;
31             1;