From: Dave Rolsky Date: Tue, 16 Sep 2008 18:42:40 +0000 (+0000) Subject: Include tidying. X-Git-Tag: 0.58~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=41daa8288dbaa0855051a097c79f22af9f866ccf;p=gitmo%2FMoose.git Include tidying. Load Carp --- diff --git a/lib/Moose/Error/Default.pm b/lib/Moose/Error/Default.pm index cd3421b..2ece542 100644 --- a/lib/Moose/Error/Default.pm +++ b/lib/Moose/Error/Default.pm @@ -3,14 +3,17 @@ package Moose::Error::Default; use strict; use warnings; +use Carp::Heavy; + + sub new { my ( $self, @args ) = @_; - $self->create_error_confess(@args); + $self->create_error_confess( @args ); } sub create_error_croak { my ( $self, @args ) = @_; - $self->_create_error_carpmess(@args); + $self->_create_error_carpmess( @args ); } sub create_error_confess { @@ -22,17 +25,15 @@ sub _create_error_carpmess { my ( $self, %args ) = @_; my $carp_level = 3 + ( $args{depth} || 1 ); - local $Carp::MaxArgNums = 20 - ; # default is 8, usually we use named args which gets messier though + local $Carp::MaxArgNums = 20; # default is 8, usually we use named args which gets messier though my @args = exists $args{message} ? $args{message} : (); if ( $args{longmess} || $Carp::Verbose ) { local $Carp::CarpLevel = ( $Carp::CarpLevel || 0 ) + $carp_level; return Carp::longmess(@args); - } - else { - return Carp::ret_summary( $carp_level, @args ); + } else { + return Carp::ret_summary($carp_level, @args); } }