lib/Myriad/Exception/Base.pm

filter: Statementstmt 96.3% 26 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.9% 10 / 11 Podpod 66.6% 2 / 3 totaltotal 92.6% 38 / 41 CC 1 SCAR 0.0
CC
1
Cov
96%
BEGIN
1.0
__ANON__
1.0
__ANON__
1.0
CRAP 1.0
« lib/Test/Myriad.pm ↑ Summary lib/Myriad/Config.pm »
1 package Myriad::Exception::Base;
2  
3 23 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 23 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 23 our $VERSION = '1.001'; # VERSION
7 23 our $AUTHORITY = 'cpan:DERIV'; # AUTHORITY
8  
9 23 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 =encoding utf8
12  
13 =head1 NAME
14  
15 Myriad::Exception::Base - common class for all exceptions
16  
17 =head1 DESCRIPTION
18  
19 See L<Myriad::Exception> for the rĂ´le which defines the exception API.
20  
21 =cut
22  
23 23 ▶no indirect qw(fatal);
Subroutine BEGIN: called CC=1 SCAR=0.0
24 23 ▶use Myriad::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 0 ▶use overload '""' => sub { shift->as_string }, bool => sub { 1 }, fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.1
Subroutine __ANON__: called CC=1 SCAR=0.1
Subroutine __ANON__: not called CC=1 SCAR=0.1
27  
28 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
29 1 my ($class, %args) = @_;
30 1 bless \%args, $class
31 }
32  
33 =head2 reason
34  
35 The failure reason. Freeform text.
36  
37 =cut
38  
39 2 ▶sub reason { shift->{reason} }
Subroutine reason: called CC=1 SCAR=0.0
Pod documented
40  
41 =head2 as_string
42  
43 Returns the exception message as a string.
44  
45 =cut
46  
47 1 ▶sub as_string { shift->message }
Subroutine as_string: called CC=1 SCAR=0.0
Pod documented
48  
49 23 1;
50  
51 =head1 AUTHOR
52  
53 Deriv Group Services Ltd. C<< DERIV@cpan.org >>.
54  
55 See L<Myriad/CONTRIBUTORS> for full details.
56  
57 =head1 LICENSE
58  
59 Copyright Deriv Group Services Ltd 2020-2022. Licensed under the same terms as Perl itself.
60  
« lib/Test/Myriad.pm ↑ Summary lib/Myriad/Config.pm »