Fritz/Error.pm

filter: Statementstmt 100% 19 / 19 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 66.6% 2 / 3 totaltotal 96.6% 29 / 30 CC 2 SCAR 2.5
CC
2
Cov
100%
BUILDARGS
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Fritz/Data.pm ↑ Summary Fritz.pm »
1 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 # Copyright (C) 2015 Christian Garbs <mitch@cgarbs.de>
4 # Licensed under GNU GPL v2 or later.
5  
6 package Net::Fritz::Error;
7 # ABSTRACT: wraps any error from the L<Net::Fritz> modules
8 4 $Net::Fritz::Error::VERSION = 'v0.0.7';
9  
10 # TODO: use a global configuration option to make every call to
11 # Net::Fritz::Error->new an immediately fatal error?
12  
13 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15  
16 4 has error => ( is => 'ro', default => 'generic error' );
17  
18  
19 sub BUILDARGS {
20 20 ▶ my ( $class, @args ) = @_;
Subroutine BUILDARGS: called CC=2 SCAR=6.9
Pod undocumented
21
22 20 ▶ unshift @args, "error" if @args % 2 == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @args % 2 == 1 18 2 20
23
24 20 return { @args };
25 };
26  
27  
28 sub errorcheck {
29 1 ▶ my $self = shift;
Subroutine errorcheck: called CC=1 SCAR=0.0
Pod documented
30 1 die "Net::Fritz::Error: " . $self->error. "\n";
31 }
32  
33  
34 sub dump {
35 1 ▶ my $self = shift;
Subroutine dump: called CC=1 SCAR=0.0
Pod documented
36  
37 1 return "Net::Fritz::Error: " . $self->error . "\n";
38 }
39  
40  
41 4 1;
42  
43 __END__
« Fritz/Data.pm ↑ Summary Fritz.pm »