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 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 6 ▶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 6 $Net::Fritz::Error::VERSION = 'v0.0.9';
9  
10 # TODO: use a global configuration option to make every call to
11 # Net::Fritz::Error->new an immediately fatal error?
12  
13 6 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15  
16 6 has error => ( is => 'ro', default => 'generic error' );
17  
18  
19 26 ▶sub BUILDARGS {
Subroutine BUILDARGS: called CC=2 SCAR=6.9
Pod undocumented
20 26 my ( $class, @args ) = @_;
21
22 26 ▶ unshift @args, "error" if @args % 2 == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @args % 2 == 1 24 2 26
23
24 26 return { @args };
25 };
26  
27  
28 1 ▶sub errorcheck {
Subroutine errorcheck: called CC=1 SCAR=0.0
Pod documented
29 1 my $self = shift;
30 1 die "Net::Fritz::Error: " . $self->error. "\n";
31 }
32  
33  
34 1 ▶sub dump {
Subroutine dump: called CC=1 SCAR=0.0
Pod documented
35 1 my $self = shift;
36  
37 1 return "Net::Fritz::Error: " . $self->error . "\n";
38 }
39  
40  
41 6 1;
42  
43 __END__
« Fritz/Data.pm ↑ Summary Fritz.pm »