Enbld/Error.pm

filter: Statementstmt 100% 18 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 3 totaltotal 88.8% 24 / 27 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Enbld/Logger.pm ↑ Summary Enbld/Target/Attribute/AllowedCondition.pm »
1 package Enbld::Error;
2  
3 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 12 ▶use overload (
Subroutine BEGIN: called CC=1 SCAR=0.0
7 12 q{""} => 'to_string',
8 fallback => 1,
9 12 );
10  
11 12 ▶sub throw {
Subroutine throw: called CC=1 SCAR=0.0
Pod undocumented
12 12 my ( $class, $message ) = @_;
13  
14 12 die $class->new( $message );
15 }
16  
17 17 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
18 17 my ( $class, $message ) = @_;
19  
20 17 chomp( $message );
21  
22 17 my $self = {
23 message => $message,
24 };
25  
26 17 return bless $self, $class;
27 }
28  
29 16 ▶sub to_string {
Subroutine to_string: called CC=1 SCAR=0.0
Pod undocumented
30 16 my $self = shift;
31  
32 16 return "ERROR:$self->{message}\n";
33 }
34  
35 12 1;
« Enbld/Logger.pm ↑ Summary Enbld/Target/Attribute/AllowedCondition.pm »