← Index
NYTProf Performance Profile   « line view »
For /usr/local/libexec/sympa/task_manager-debug.pl
  Run on Tue Jun 1 22:32:51 2021
Reported on Tue Jun 1 22:35:05 2021

Filename/usr/local/lib/perl5/site_perl/Specio/Exception.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sSpecio::Exception::::BEGIN@12Specio::Exception::BEGIN@12
0000s0sSpecio::Exception::::BEGIN@13Specio::Exception::BEGIN@13
0000s0sSpecio::Exception::::BEGIN@14Specio::Exception::BEGIN@14
0000s0sSpecio::Exception::::BEGIN@3Specio::Exception::BEGIN@3
0000s0sSpecio::Exception::::BEGIN@4Specio::Exception::BEGIN@4
0000s0sSpecio::Exception::::BEGIN@7Specio::Exception::BEGIN@7
0000s0sSpecio::Exception::::BUILDSpecio::Exception::BUILD
0000s0sSpecio::Exception::::__ANON__Specio::Exception::__ANON__ (xsub)
0000s0sSpecio::Exception::::_attrsSpecio::Exception::_attrs
0000s0sSpecio::Exception::::as_stringSpecio::Exception::as_string
0000s0sSpecio::Exception::::throwSpecio::Exception::throw
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Specio::Exception;
2
3use strict;
4use warnings;
5
6use overload
7 q{""} => 'as_string',
8 fallback => 1;
9
10our $VERSION = '0.47';
11
12use Devel::StackTrace;
13use Scalar::Util qw( blessed );
14use Specio::OO;
15
16{
17 my $attrs = {
18 message => {
19 isa => 'Str',
20 required => 1,
21 },
22 type => {
23 does => 'Specio::Constraint::Role::Interface',
24 required => 1,
25 },
26 value => {
27 required => 1,
28 },
29 stack_trace => {
30 init_arg => undef,
31 },
32 };
33
34 ## no critic (Subroutines::ProhibitUnusedPrivateSubroutines)
35 sub _attrs {
36 return $attrs;
37 }
38}
39
40sub BUILD {
41 my $self = shift;
42
43 $self->{stack_trace}
44 = Devel::StackTrace->new( ignore_package => __PACKAGE__ );
45
46 return;
47}
48
49sub as_string {
50 my $self = shift;
51
52 my $str = $self->message;
53 $str .= "\n\n" . $self->stack_trace->as_string;
54
55 return $str;
56}
57
58sub throw {
59 my $self = shift;
60
61 die $self if blessed $self;
62
63 die $self->new(@_);
64}
65
66__PACKAGE__->_ooify;
67
681;
69
70# ABSTRACT: An exception class for type constraint failures
71
72__END__