Filename | /opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Error/Default.pm |
Statements | Executed 32 statements in 728µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 392µs | 447µs | BEGIN@15 | Moose::Error::Default::
1 | 1 | 1 | 146µs | 156µs | BEGIN@12 | Moose::Error::Default::
5 | 1 | 1 | 38µs | 38µs | _inline_new | Moose::Error::Default::
1 | 1 | 1 | 11µs | 11µs | BEGIN@2 | Moose::Error::Default::
1 | 1 | 1 | 10µs | 14µs | BEGIN@10 | Moose::Error::Default::
1 | 1 | 1 | 9µs | 97µs | BEGIN@17 | Moose::Error::Default::
1 | 1 | 1 | 8µs | 24µs | BEGIN@9 | Moose::Error::Default::
1 | 1 | 1 | 6µs | 6µs | BEGIN@13 | Moose::Error::Default::
0 | 0 | 0 | 0s | 0s | create_error_confess | Moose::Error::Default::
0 | 0 | 0 | 0s | 0s | create_error_croak | Moose::Error::Default::
0 | 0 | 0 | 0s | 0s | new | Moose::Error::Default::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Moose::Error::Default; | ||||
2 | # spent 11µs within Moose::Error::Default::BEGIN@2 which was called:
# once (11µs+0s) by Moose::Meta::Class::BEGIN@23 at line 4 | ||||
3 | 1 | 12µs | $Moose::Error::Default::AUTHORITY = 'cpan:STEVAN'; | ||
4 | 1 | 40µs | 1 | 11µs | } # spent 11µs making 1 call to Moose::Error::Default::BEGIN@2 |
5 | { | ||||
6 | 2 | 1µs | $Moose::Error::Default::VERSION = '2.1005'; | ||
7 | } | ||||
8 | |||||
9 | 2 | 31µs | 2 | 40µs | # spent 24µs (8+16) within Moose::Error::Default::BEGIN@9 which was called:
# once (8µs+16µs) by Moose::Meta::Class::BEGIN@23 at line 9 # spent 24µs making 1 call to Moose::Error::Default::BEGIN@9
# spent 16µs making 1 call to strict::import |
10 | 2 | 40µs | 2 | 19µs | # spent 14µs (10+5) within Moose::Error::Default::BEGIN@10 which was called:
# once (10µs+5µs) by Moose::Meta::Class::BEGIN@23 at line 10 # spent 14µs making 1 call to Moose::Error::Default::BEGIN@10
# spent 5µs making 1 call to warnings::import |
11 | |||||
12 | 2 | 133µs | 1 | 156µs | # spent 156µs (146+9) within Moose::Error::Default::BEGIN@12 which was called:
# once (146µs+9µs) by Moose::Meta::Class::BEGIN@23 at line 12 # spent 156µs making 1 call to Moose::Error::Default::BEGIN@12 |
13 | 2 | 30µs | 1 | 6µs | # spent 6µs within Moose::Error::Default::BEGIN@13 which was called:
# once (6µs+0s) by Moose::Meta::Class::BEGIN@23 at line 13 # spent 6µs making 1 call to Moose::Error::Default::BEGIN@13 |
14 | |||||
15 | 2 | 130µs | 1 | 447µs | # spent 447µs (392+55) within Moose::Error::Default::BEGIN@15 which was called:
# once (392µs+55µs) by Moose::Meta::Class::BEGIN@23 at line 15 # spent 447µs making 1 call to Moose::Error::Default::BEGIN@15 |
16 | |||||
17 | 2 | 262µs | 2 | 184µs | # spent 97µs (9+88) within Moose::Error::Default::BEGIN@17 which was called:
# once (9µs+88µs) by Moose::Meta::Class::BEGIN@23 at line 17 # spent 97µs making 1 call to Moose::Error::Default::BEGIN@17
# spent 88µs making 1 call to base::import |
18 | |||||
19 | 1 | 2µs | 1 | 7.01ms | Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait'); # spent 7.01ms making 1 call to Class::MOP::MiniTrait::apply |
20 | |||||
21 | sub new { | ||||
22 | my ( $self, @args ) = @_; | ||||
23 | # can't use Moose::Error::Util::create_error here because that would break | ||||
24 | # inheritance. we don't care about that for the inlined version, because | ||||
25 | # the inlined versions are explicitly not inherited. | ||||
26 | if (defined $ENV{MOOSE_ERROR_STYLE} && $ENV{MOOSE_ERROR_STYLE} eq 'croak') { | ||||
27 | $self->create_error_croak( @args ); | ||||
28 | } | ||||
29 | else { | ||||
30 | $self->create_error_confess( @args ); | ||||
31 | } | ||||
32 | } | ||||
33 | |||||
34 | # spent 38µs within Moose::Error::Default::_inline_new which was called 5 times, avg 8µs/call:
# 5 times (38µs+0s) by Moose::Meta::Class::_inline_create_error at line 855 of Moose/Meta/Class.pm, avg 8µs/call | ||||
35 | 5 | 9µs | my ( $self, %args ) = @_; | ||
36 | |||||
37 | 5 | 6µs | my $depth = ($args{depth} || 0) - 1; | ||
38 | 5 | 27µs | return 'Moose::Error::Util::create_error(' | ||
39 | . 'message => ' . $args{message} . ', ' | ||||
40 | . 'depth => ' . $depth . ', ' | ||||
41 | . ')'; | ||||
42 | } | ||||
43 | |||||
44 | sub create_error_croak { | ||||
45 | my ( $self, @args ) = @_; | ||||
46 | return Moose::Error::Util::create_error_croak(@args); | ||||
47 | } | ||||
48 | |||||
49 | sub create_error_confess { | ||||
50 | my ( $self, @args ) = @_; | ||||
51 | return Moose::Error::Util::create_error_confess(@args); | ||||
52 | } | ||||
53 | |||||
54 | 1 | 5µs | 1; | ||
55 | |||||
56 | # ABSTRACT: L<Carp> based error generation for Moose. | ||||
57 | |||||
58 | __END__ |