blib/lib/Iterator/Flex/Role/Error/Throw.pm

filter: Statementstmt 100% 32 / 32 Branchbran 100% 2 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 9 / 9 Podpod 100% 1 / 1 totaltotal 91.8% 45 / 49 CC 4 SCAR 7.1
CC
4
Cov
95%
signal_error
4.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« blib/lib/Iterator/Flex/Stack.pm ↑ Summary blib/lib/Iterator/Flex/Role/State/Registry.pm »
1 package Iterator::Flex::Role::Error::Throw;
2  
3 # ABSTRACT: signal error by throwing
4  
5 30 ▶use v5.28;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 30 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 30 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 30 our $VERSION = '0.33';
10  
11 30 ▶use Iterator::Flex::Utils qw( :default REG_GENERAL REG_GP_ERROR );
Subroutine BEGIN: called CC=1 SCAR=0.0
12 30 ▶use Ref::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 30 ▶use Role::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 30 ▶use experimental 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 30 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35 2 ▶sub signal_error ( $self, $message = undef ) {
Subroutine signal_error: called CC=4 SCAR=14.0
Pod documented
36 2 $self->set_error;
37 2 my $exception = $REGISTRY{ refaddr $self }[REG_GENERAL][REG_GP_ERROR][1];
38  
39 2 ▶ my @message = ( $message // () );
Condition33%1/3
$message // ()
l!l&&r!l&&!r
200
MC/DC0%0/2
$message // ()
$message ()
Truth table33%1/3
A // B
A= $messageB= ()
ABresult
1X1
011
000
40  
41 2 ▶ $exception->( @message ) if Ref::Util::is_coderef( $exception );
Branch: 1 branch
BranchTrueFalseTotal
if Ref::Util::XS::is_coderef($exception) 1 1 2
42  
43 1 require Iterator::Flex::Failure;
44 1 Iterator::Flex::Failure::Error->throw( @message );
45 }
46  
47  
48 30 1;
49  
50 #
51 # This file is part of Iterator-Flex
52 #
53 # This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory.
54 #
55 # This is free software, licensed under:
56 #
57 # The GNU General Public License, Version 3, June 2007
58 #
59  
60 __END__
« blib/lib/Iterator/Flex/Stack.pm ↑ Summary blib/lib/Iterator/Flex/Role/State/Registry.pm »