← Index
NYTProf Performance Profile   « block view • line view • sub view »
For 05.Domain_and_Item.t
  Run on Tue May 4 17:21:41 2010
Reported on Tue May 4 17:22:22 2010

File /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Moose/Error/Default.pm
Statements Executed 13
Statement Execution Time 311µs
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.17ms1.25msMoose::Error::Default::::BEGIN@10Moose::Error::Default::BEGIN@10
11113µs16µsMoose::Error::Default::::BEGIN@3Moose::Error::Default::BEGIN@3
1117µs16µsMoose::Error::Default::::BEGIN@4Moose::Error::Default::BEGIN@4
0000s0sMoose::Error::Default::::_create_error_carpmessMoose::Error::Default::_create_error_carpmess
0000s0sMoose::Error::Default::::create_error_confessMoose::Error::Default::create_error_confess
0000s0sMoose::Error::Default::::create_error_croakMoose::Error::Default::create_error_croak
0000s0sMoose::Error::Default::::newMoose::Error::Default::new
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moose::Error::Default;
2
3319µs219µs
# spent 16µs (13+3) within Moose::Error::Default::BEGIN@3 which was called # once (13µs+3µs) by Moose::Meta::Class::BEGIN@20 at line 3
use strict;
# spent 16µs making 1 call to Moose::Error::Default::BEGIN@3 # spent 3µs making 1 call to strict::import
4339µs225µs
# spent 16µs (7+9) within Moose::Error::Default::BEGIN@4 which was called # once (7µs+9µs) by Moose::Meta::Class::BEGIN@20 at line 4
use warnings;
# spent 16µs making 1 call to Moose::Error::Default::BEGIN@4 # spent 9µs making 1 call to warnings::import
5
61600nsour $VERSION = '0.98';
7120µs$VERSION = eval $VERSION;
81300nsour $AUTHORITY = 'cpan:STEVAN';
9
103227µs11.25ms
# spent 1.25ms (1.17+83µs) within Moose::Error::Default::BEGIN@10 which was called # once (1.17ms+83µs) by Moose::Meta::Class::BEGIN@20 at line 10
use Carp::Heavy;
# spent 1.25ms making 1 call to Moose::Error::Default::BEGIN@10
11
12
13sub new {
14 my ( $self, @args ) = @_;
15 $self->create_error_confess( @args );
16}
17
18sub create_error_croak {
19 my ( $self, @args ) = @_;
20 $self->_create_error_carpmess( @args );
21}
22
23sub create_error_confess {
24 my ( $self, @args ) = @_;
25 $self->_create_error_carpmess( @args, longmess => 1 );
26}
27
28sub _create_error_carpmess {
29 my ( $self, %args ) = @_;
30
31 my $carp_level = 3 + ( $args{depth} || 1 );
32 local $Carp::MaxArgNums = 20; # default is 8, usually we use named args which gets messier though
33
34 my @args = exists $args{message} ? $args{message} : ();
35
36 if ( $args{longmess} || $Carp::Verbose ) {
37 local $Carp::CarpLevel = ( $Carp::CarpLevel || 0 ) + $carp_level;
38 return Carp::longmess(@args);
39 } else {
40 return Carp::ret_summary($carp_level, @args);
41 }
42}
43
4414µs__PACKAGE__
45
46__END__
47
48=pod
49
50=head1 NAME
51
52Moose::Error::Default - L<Carp> based error generation for Moose.
53
54=head1 DESCRIPTION
55
56This class implements L<Carp> based error generation.
57
58The default behavior is like L<Moose::Error::Confess>.
59
60=head1 METHODS
61
62=over 4
63
64=item new @args
65
66Create a new error. Delegates to C<create_error_confess>.
67
68=item create_error_confess @args
69
70=item create_error_croak @args
71
72Creates a new errors string of the specified style.
73
74=back
75
76=cut
77
78