diff options
Diffstat (limited to 'lib/Moose/Exception/CircularReferenceInAlso.pm')
-rw-r--r-- | lib/Moose/Exception/CircularReferenceInAlso.pm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/Moose/Exception/CircularReferenceInAlso.pm b/lib/Moose/Exception/CircularReferenceInAlso.pm new file mode 100644 index 0000000..7306adf --- /dev/null +++ b/lib/Moose/Exception/CircularReferenceInAlso.pm @@ -0,0 +1,30 @@ +package Moose::Exception::CircularReferenceInAlso; +our $VERSION = '2.1405'; + +use Moose; +extends 'Moose::Exception'; + +has 'also_parameter' => ( + is => 'ro', + isa => 'Str', + required => 1 +); + +has 'stack' => ( + is => 'ro', + isa => 'ArrayRef', + required => 1 +); + +sub _build_message { + my $self = shift; + my $also_member = $self->also_parameter; + + my @stack = @{$self->stack}; + my $existing_stack = join( ', ', @stack); + + return "Circular reference in 'also' parameter to Moose::Exporter between " + ."$existing_stack and $also_member"; +} + +1; |